OCCNurbsSurface
- class compas_occ.geometry.OCCNurbsSurface(*args, **kwargs)[source]
Bases:
compas_occ.geometry.surfaces.surface.OCCSurface
,compas.geometry.surfaces.nurbs.NurbsSurface
Class representing a NURBS surface based on the BSplineSurface of the OCC geometry kernel.
- Parameters
name (str, optional) – The name of the curve
- Attributes
points (list[list[
Point
]], read-only) – The control points of the surface.weights (list[list[float]], read-only) – The weights of the control points of the surface.
u_knots (list[float], read-only) – The knots of the surface in the U direction, without multiplicities.
v_knots (list[float], read-only) – The knots of the surface in the V direction, without multiplicities.
u_mults (list[int], read-only) – The multiplicities of the knots of the surface in the U direction.
v_mults (list[int], read-only) – The multiplicities of the knots of the surface in the V direction.
- Other Attributes
occ_surface (
Geom_BSplineSurface
) – The underlying OCC surface.
Examples
Construct a surface from points…
from compas.geometry import Point from compas_occ.geometry import OCCNurbsSurface points = [ [Point(0, 0, 0), Point(1, 0, 0), Point(2, 0, 0), Point(3, 0, 0)], [Point(0, 1, 0), Point(1, 1, 2), Point(2, 1, 2), Point(3, 1, 0)], [Point(0, 2, 0), Point(1, 2, 2), Point(2, 2, 2), Point(3, 2, 0)], [Point(0, 3, 0), Point(1, 3, 0), Point(2, 3, 0), Point(3, 3, 0)], ] surface = OCCNurbsSurface.from_points(points=points)
Construct a surface from points…
from compas.geometry import Point from compas_occ.geometry import OCCNurbsSurface points = [ [Point(0, 0, 0), Point(1, 0, +0), Point(2, 0, +0), Point(3, 0, +0), Point(4, 0, +0), Point(5, 0, 0)], [Point(0, 1, 0), Point(1, 1, -1), Point(2, 1, -1), Point(3, 1, -1), Point(4, 1, -1), Point(5, 1, 0)], [Point(0, 2, 0), Point(1, 2, -1), Point(2, 2, +2), Point(3, 2, +2), Point(4, 2, -1), Point(5, 2, 0)], [Point(0, 3, 0), Point(1, 3, -1), Point(2, 3, +2), Point(3, 3, +2), Point(4, 3, -1), Point(5, 3, 0)], [Point(0, 4, 0), Point(1, 4, -1), Point(2, 4, -1), Point(3, 4, -1), Point(4, 4, -1), Point(5, 4, 0)], [Point(0, 5, 0), Point(1, 5, +0), Point(2, 5, +0), Point(3, 5, +0), Point(4, 5, +0), Point(5, 5, 0)], ] weights = [ [1.0, 1.0, 1.0, 1.0, 1.0, 1.0], [1.0, 1.0, 1.0, 1.0, 1.0, 1.0], [1.0, 1.0, 1.0, 1.0, 1.0, 1.0], [1.0, 1.0, 1.0, 1.0, 1.0, 1.0], [1.0, 1.0, 1.0, 1.0, 1.0, 1.0], [1.0, 1.0, 1.0, 1.0, 1.0, 1.0], ] surface = OCCNurbsSurface.from_parameters( points=points, weights=weights, u_knots=[1.0, 1 + 1/9, 1 + 2/9, 1 + 3/9, 1 + 4/9, 1 + 5/9, 1 + 6/9, 1 + 7/9, 1 + 8/9, 2.0], v_knots=[0.0, 1/9, 2/9, 3/9, 4/9, 5/9, 6/9, 7/9, 8/9, 1.0], u_mults=[1, 1, 1, 1, 1, 1, 1, 1, 1, 1], v_mults=[1, 1, 1, 1, 1, 1, 1, 1, 1, 1], u_degree=3, v_degree=3, )
Methods
Make an independent copy of the current surface.
Construct a BSpline surface from its data representation.
Construct a NURBS surface from an extrusion of a basis curve.
Construct a NURBS surface from the infill between two, three or four contiguous NURBS curves.
Construct a NURBS surface by approximating or interpolating a 2D collection of points.
Construct a NURBS surface from explicit parameters.
Construct a NURBS surface from control points.
Load a NURBS surface from a STP file.
Inherited Methods
Converts the instance to a string.
Compute the axis aligned bounding box of the surface.
Compute the boundary curves of the surface.
Compute the closest point on the curve to a given point.
Compute the curvature at a point on the surface.
Compute the local frame at a point on the curve.
Construct surface from an existing OCC TopoDS_Face.
Construct an object from serialized data contained in a JSON file.
Construct an object from serialized data contained in a JSON string.
Construct a NURBS surface from a mesh grid.
Load a surface from an OBJ file.
Construct a NUBRS surface from an existing OCC BSplineSurface.
Compute the intersections with a line.
Compute the oriented bounding box of the surface.
Compute a point on the surface.
Compute a hash of the data for comparison during version control using the sha256 algorithm.
Convert an object to its native data representation.
Serialize the data representation of an object to a JSON file.
Serialize the data representation of an object to a JSON string.
Convert the surface to a quad mesh.
Write the surface geometry to a STP file.
Convert the surface to a triangle mesh.
Convert the surface to a list of triangles.
Transform this surface.
Returns a transformed copy of this geometry.
Compute the isoparametric curve at parameter u.
Compute evenly spaced parameters over the surface domain in the U direction.
Compute the isoparametric curve at parameter v.
Compute evenly spaced parameters over the surface domain in the V direction.
Validate the object's data against its data schema.
Validate the object's data against its json schema.
Compute point locations corresponding to evenly spaced parameters over the surface domain.