SketchNurbs
#
- class ansys.geometry.core.sketch.nurbs.SketchNurbs#
Bases:
ansys.geometry.core.sketch.edge.SketchEdge
Represents a NURBS sketch curve.
Warning
NURBS sketching is only supported in 26R1 and later versions of Ansys.
Notes
This class is a wrapper around the NURBS curve class from the geomdl library. By leveraging the geomdl library, this class provides a high-level interface to create and manipulate NURBS curves. The geomdl library is a powerful library for working with NURBS curves and surfaces. For more information, see https://pypi.org/project/geomdl/.
Overview#
Fit a NURBS curve to a set of points. |
Check if the curve contains a given point within a specified tolerance. |
Get the underlying NURBS curve. |
|
Get the control points of the curve. |
|
Get the degree of the curve. |
|
Get the knot vector of the curve. |
|
Get the weights of the control points. |
|
Get the start point of the curve. |
|
Get the end point of the curve. |
|
Get the VTK polydata representation for PyVista visualization. |
Import detail#
from ansys.geometry.core.sketch.nurbs import SketchNurbs
Property detail#
- property SketchNurbs.geomdl_nurbs_curve: geomdl.NURBS.Curve#
Get the underlying NURBS curve.
Notes
This property gives access to the full functionality of the NURBS curve coming from the geomdl library. Use with caution.
- property SketchNurbs.control_points: list[ansys.geometry.core.math.point.Point2D]#
Get the control points of the curve.
- property SketchNurbs.knots: list[ansys.geometry.core.typing.Real]#
Get the knot vector of the curve.
- property SketchNurbs.weights: list[ansys.geometry.core.typing.Real]#
Get the weights of the control points.
- property SketchNurbs.start: ansys.geometry.core.math.point.Point2D#
Get the start point of the curve.
- property SketchNurbs.end: ansys.geometry.core.math.point.Point2D#
Get the end point of the curve.
- property SketchNurbs.visualization_polydata: pyvista.PolyData#
Get the VTK polydata representation for PyVista visualization.
- Returns:
pyvista.PolyData
VTK pyvista.Polydata configuration.
Notes
The representation lies in the X/Y plane within the standard global Cartesian coordinate system.
Method detail#
- SketchNurbs.contains_point(point: ansys.geometry.core.math.point.Point2D, tolerance: ansys.geometry.core.typing.Real = 1e-06) bool #
Check if the curve contains a given point within a specified tolerance.
- Parameters:
- point
Point2D
The point to check.
- tolerance
Real
,optional
The tolerance for the containment check, by default 1e-6.
- point
- Returns:
- bool
True if the curve contains the point within the tolerance, False otherwise.
- classmethod SketchNurbs.fit_curve_from_points(points: list[ansys.geometry.core.math.point.Point2D], degree: int = 3) SketchNurbs #
Fit a NURBS curve to a set of points.