NURBSSurface
#
- class ansys.geometry.core.shapes.surfaces.nurbs.NURBSSurface(geomdl_object: geomdl.NURBS.Surface = None)#
Bases:
ansys.geometry.core.shapes.surfaces.surface.Surface
Represents 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. |
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.
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) 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.
- degree_u
- Returns:
NURBSSurface
Created 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) NURBSSurface #
Fit a NURBS surface to a set of points.
- Parameters:
- Returns:
NURBSSurface
Fitted 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:
SurfaceEvaluation
Evaluation 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.