NurbsSurface
- class compas.geometry.NurbsSurface(*args, **kwargs)[source]
Bases:
compas.geometry.surfaces.surface.Surface
Class representing a NURBS surface.
- Attributes
points (List[Point]) – The control points of the surface.
weights (List[float]) – The weights of the control points.
u_knots (List[float]) – The knot vector, in the U direction, without duplicates.
v_knots (List[float]) – The knot vector, in the V direction, without duplicates.
u_mults (List[int]) – The multiplicities of the knots in the knot vector of the U direction.
v_mults (List[int]) – The multiplicities of the knots in the knot vector of the V direction.
u_degree (int) – The degree of the polynomials in the U direction.
v_degree (int) – The degree of the polynomials in the V direction.
u_domain (Tuple[float, float]) – The parameter domain in the U direction.
v_domain (Tuple[float, float]) – The parameter domain in the V direction.
is_u_periodic (bool) – True if the curve is periodic in the U direction.
is_v_periodic (bool) – True if the curve is periodic in the V direction.
Methods
aabb
([precision, optimal])Compute the axis aligned bounding box of the surface.
boundary
()Compute the boundary curves of the surface.
closest_point
(point[, distance])Compute the closest point on the curve to a given point.
copy
()Make an independent copy of the surface.
curvature_at
(u, v)Compute the curvature at a point on the surface.
frame_at
(u, v)Compute the local frame at a point on the curve.
from_data
(data)Construct a BSpline surface from its data representation.
from_fill
(curve1, curve2)Construct a NURBS surface from the infill between two NURBS curves.
from_json
(filepath)Construct an object from serialized data contained in a JSON file.
from_jsonstring
(string)Construct an object from serialized data contained in a JSON string.
from_meshgrid
([nu, nv])Construct a NURBS surface from a mesh grid.
from_parameters
(points, weights, u_knots, ...)Construct a NURBS surface from explicit parameters.
from_points
(points[, u_degree, v_degree])Construct a NURBS surface from control points.
from_step
(filepath)Load a NURBS surface from a STP file.
intersections_with_line
(line)Compute the intersections with a line.
obb
([precision])Compute the oriented bounding box of the surface.
point_at
(u, v)Compute a point on the surface.
to_data
()Convert an object to its native data representation.
to_json
(filepath[, pretty])Serialize the data representation of an object to a JSON file.
to_jsonstring
([pretty])Serialize the data representation of an object to a JSON string.
to_mesh
([nu, nv])Convert the surface to a quad mesh.
to_step
(filepath[, schema])Write the surface geometry to a STP file.
to_triangles
([nu, nv])Convert the surface to a list of triangles.
transform
(T)Transform this surface.
transformed
(T)Transform an independent copy of this surface.
u_isocurve
(u)Compute the isoparametric curve at parameter u.
u_space
([n])Compute evenly spaced parameters over the surface domain in the U direction.
v_isocurve
(v)Compute the isoparametric curve at parameter v.
v_space
([n])Compute evenly spaced parameters over the surface domain in the V direction.
Validate the object's data against its data schema (self.DATASCHEMA).
Validate the object's data against its json schema (self.JSONSCHEMA).
xyz
([nu, nv])Compute point locations corresponding to evenly spaced parameters over the surface domain.