NURBSSurface#
- class ansys.geometry.core.shapes.surfaces.nurbs.NURBSSurface(origin: ansys.geometry.core.math.Point3D = ZERO_POINT3D, reference: ansys.geometry.core.math.vector.UnitVector3D = UNITVECTOR3D_X, axis: ansys.geometry.core.math.vector.UnitVector3D = UNITVECTOR3D_Z, geomdl_object: geomdl.NURBS.Surface = None)#
Bases:
ansys.geometry.core.shapes.surfaces.surface.SurfaceRepresents a NURBS surface.
Notes
This class is a wrapper around the NURBS surface class from the geomdl library. By leveraging the geomdl library, this class provides a high-level interface to create and manipulate NURBS surfaces. The geomdl library is a powerful library for working with NURBS curves and surfaces. For more information, see https://pypi.org/project/geomdl/.
Overview#
Create a transformed copy of the surface. |
|
Check a parameter is within the parametric range of the surface. |
|
Check a point is contained by the surface. |
|
Project a point to the surface. |
Create a NURBS surface from control points and knot vectors. |
|
Fit a NURBS surface to a set of points. |
Get the parametrization of the NURBS surface. |
|
Evaluate the surface at the given parameter. |
Get the underlying geomdl NURBS surface object. |
|
Get the control points of the NURBS surface. |
|
Get the degree of the surface in the U direction. |
|
Get the degree of the surface in the V direction. |
|
Get the knot vector for the u-direction of the surface. |
|
Get the knot vector for the v-direction of the surface. |
|
Get the weights of the control points. |
|
Get the origin of the surface. |
|
Get the reference direction of the surface. |
|
Get the axis direction of the surface. |
Determine if two surfaces are equal. |
Import detail#
from ansys.geometry.core.shapes.surfaces.nurbs import NURBSSurface
Property detail#
- property NURBSSurface.geomdl_nurbs_surface: geomdl.NURBS.Surface#
Get the underlying geomdl NURBS surface object.
Notes
This property gives access to the full functionality of the NURBS surface coming from the geomdl library. Use with caution.
- property NURBSSurface.control_points: list[ansys.geometry.core.math.Point3D]#
Get the control points of the NURBS surface.
- property NURBSSurface.knotvector_u: list[ansys.geometry.core.typing.Real]#
Get the knot vector for the u-direction of the surface.
- property NURBSSurface.knotvector_v: list[ansys.geometry.core.typing.Real]#
Get the knot vector for the v-direction of the surface.
- property NURBSSurface.weights: list[ansys.geometry.core.typing.Real]#
Get the weights of the control points.
- property NURBSSurface.origin: ansys.geometry.core.math.Point3D#
Get the origin of the surface.
- property NURBSSurface.dir_x: ansys.geometry.core.math.vector.UnitVector3D#
Get the reference direction of the surface.
- property NURBSSurface.dir_z: ansys.geometry.core.math.vector.UnitVector3D#
Get the axis direction of the surface.
Method detail#
- classmethod NURBSSurface.from_control_points(degree_u: int, degree_v: int, knots_u: list[ansys.geometry.core.typing.Real], knots_v: list[ansys.geometry.core.typing.Real], control_points: list[ansys.geometry.core.math.Point3D], weights: list[ansys.geometry.core.typing.Real] = None, origin: ansys.geometry.core.math.Point3D = ZERO_POINT3D, reference: ansys.geometry.core.math.vector.UnitVector3D = UNITVECTOR3D_X, axis: ansys.geometry.core.math.vector.UnitVector3D = UNITVECTOR3D_Z) NURBSSurface#
Create a NURBS surface from control points and knot vectors.
- Parameters:
- degree_u
int Degree of the surface in the U direction.
- degree_v
int Degree of the surface in the V direction.
- knots_u
list[Real] Knot vector for the U direction.
- knots_v
list[Real] Knot vector for the V direction.
- control_points
list[Point3D] Control points for the surface.
- weights
list[Real],optional Weights for the control points. If not provided, all weights are set to 1.
- delta
float,optional Evaluation delta for the surface. Default is 0.01.
- origin
Point3D,optional Origin of the surface. Default is (0, 0, 0).
- reference
UnitVector3D,optional Reference direction of the surface. Default is (1, 0, 0).
- axis
UnitVector3D,optional Axis direction of the surface. Default is (0, 0, 1).
- degree_u
- Returns:
NURBSSurfaceCreated NURBS surface.
- classmethod NURBSSurface.fit_surface_from_points(points: list[ansys.geometry.core.math.Point3D], size_u: int, size_v: int, degree_u: int, degree_v: int, origin: ansys.geometry.core.math.Point3D = ZERO_POINT3D, reference: ansys.geometry.core.math.vector.UnitVector3D = UNITVECTOR3D_X, axis: ansys.geometry.core.math.vector.UnitVector3D = UNITVECTOR3D_Z) NURBSSurface#
Fit a NURBS surface to a set of points.
- Parameters:
- points
list[Point3D] Points to fit the surface to.
- size_u
int Number of control points in the U direction.
- size_v
int Number of control points in the V direction.
- degree_u
int Degree of the surface in the U direction.
- degree_v
int Degree of the surface in the V direction.
- origin
Point3D,optional Origin of the surface. Default is (0, 0, 0).
- reference
UnitVector3D,optional Reference direction of the surface. Default is (1, 0, 0).
- axis
UnitVector3D,optional Axis direction of the surface. Default is (0, 0, 1).
- points
- Returns:
NURBSSurfaceFitted NURBS surface.
- NURBSSurface.__eq__(other: NURBSSurface) bool#
Determine if two surfaces are equal.
- NURBSSurface.parameterization() tuple[ansys.geometry.core.shapes.parameterization.Parameterization, ansys.geometry.core.shapes.parameterization.Parameterization]#
Get the parametrization of the NURBS surface.
The parameter is defined in the interval [0, 1] by default. Information is provided about the parameter type and form.
- Returns:
tuple[Parameterization,Parameterization]Parameterization in the U and V directions respectively.
- abstractmethod NURBSSurface.transformed_copy(matrix: ansys.geometry.core.math.matrix.Matrix44) NURBSSurface#
Create a transformed copy of the surface.
- NURBSSurface.evaluate(parameter: ansys.geometry.core.shapes.parameterization.ParamUV) ansys.geometry.core.shapes.surfaces.surface_evaluation.SurfaceEvaluation#
Evaluate the surface at the given parameter.
- Parameters:
- parameter
ParamUV Parameter to evaluate the surface at.
- parameter
- Returns:
SurfaceEvaluationEvaluation of the surface at the given parameter.
- abstractmethod NURBSSurface.contains_param(param: ansys.geometry.core.shapes.parameterization.ParamUV) bool#
Check a parameter is within the parametric range of the surface.
- abstractmethod NURBSSurface.contains_point(point: ansys.geometry.core.math.Point3D) bool#
Check a point is contained by the surface.
The point can either lie within the surface or on its boundary.
- abstractmethod NURBSSurface.project_point(point: ansys.geometry.core.math.Point3D) ansys.geometry.core.shapes.surfaces.surface_evaluation.SurfaceEvaluation#
Project a point to the surface.
This method returns the evaluation at the closest point.