To OCP#

Conversion from volmdlr objects to OCP (OpenCASCADE Python).

Module to translate objects in Volmdlr to OCP.

volmdlr.to_ocp.beziercurve2d_to_ocp(beziercurve) Geom2d_BezierCurve#

Create a Bezier Curve 2D from a volmdlr object.

Parameters:

beziercurve – volmdlr Bezier Curve 2D.

Returns:

Geom2d_BezierCurve

volmdlr.to_ocp.beziercurve3d_to_ocp(beziercurve)#

Create a Bezier Curve 3D from a volmdlr object.

Parameters:

beziercurve – volmdlr Bezier Curve 3D.

Returns:

Geom_BezierCurve

volmdlr.to_ocp.bsplinecurve2d_to_ocp(bsplinecurve) Geom2d_BSplineCurve#

Create a Bspline Curve 3D from a volmdlr object.

Parameters:

bsplinecurve – volmdlr BSpline Curve 2D.

Returns:

Geom2d_BSplineCurve

volmdlr.to_ocp.bsplinecurve3d_to_ocp(bsplinecurve) Geom_BSplineCurve#

Create a Bspline Curve 3D from a volmdlr object.

Parameters:

bsplinecurve – volmdlr BSpline Curve 3D.

Returns:

Geom_BSplineCurve

volmdlr.to_ocp.bsplinesurface_to_ocp(surface) Geom_BSplineSurface#

Create an OCP BSplineSurface3D from a voldmlr FraBSplineSurface3Dme3D.

Parameters:

surface – volmdlr BSplineSurface3D.

Returns:

OCP BSplineSurface.

volmdlr.to_ocp.build_gp_ax1(origin: Point3D, direction: Vector3D) gp_Ax1#

Build a gp_Ax1 from a point and a direction.

volmdlr.to_ocp.circle2d_to_ocp(circle) Geom2d_Circle#

Create an OCP Circle from a voldmlr Circle3D.

Parameters:

circle – volmdlr Circle3D.

Returns:

OCP Geom_Circle.

volmdlr.to_ocp.circle3d_to_ocp(circle) Geom_Circle#

Create an OCP Circle from a voldmlr Circle3D.

Parameters:

circle – volmdlr Circle3D.

Returns:

OCP Geom_Circle.

volmdlr.to_ocp.closedpolygon3d_to_ocp(closedpolygon3d)#

Create a OCCT wire from a volmdlr object.

Parameters:

closedpolygon3d – volmdlr Closed Polygon 3D.

Returns:

volmdlr.to_ocp.conicalsurface_to_ocp(surface) Geom_ConicalSurface#

Create an OCP ConicalSurface from a voldmlr ConicalSurface3D.

Parameters:

surface – volmdlr ConicalSurface3D.

Returns:

OCP ConicalSurface.

volmdlr.to_ocp.contour2d_to_ocp(contour2d, ocp_surface=None) TopoDS_Wire#

Create a OCCT wire from a volmdlr object.

Parameters:
  • contour2d – volmdlr Contour2D.

  • ocp_surface – (Optional) OCCT surface if the edge is a parametric t of the surface.

Returns:

volmdlr.to_ocp.contour3d_to_ocp(contour3d) TopoDS_Wire#

Create a OCCT wire from a volmdlr object.

Parameters:

contour3d – volmdlr Contour3D.

Returns:

volmdlr.to_ocp.curve_ocp_from_edge_volmdlr(edge3d)#

Get the OCP curve from a volmdlr edge.

volmdlr.to_ocp.cylindricalsurface_to_ocp(surface) Geom_CylindricalSurface#

Create an OCP CylindricalSurface from a voldmlr CylindricalSurface3D.

Parameters:

surface – volmdlr CylindricalSurface3D.

Returns:

OCP CylindricalSurface.

volmdlr.to_ocp.edge2d_to_ocp(edge2d, ocp_surface=None) TopoDS_Edge#

Create a OCCT edge from a volmdlr object.

Parameters:
  • edge2d – volmdlr Contour3D.

  • ocp_surface – (Optional) OCCT surface if the edge is a parametric representation of the surface.

Returns:

volmdlr.to_ocp.edge3d_to_ocp(edge3d) TopoDS_Edge#

Create a OCCT edge from a volmdlr object.

Parameters:

edge3d – volmdlr edge 3D.

Returns:

volmdlr.to_ocp.ellipse2d_to_ocp(ellipse) Geom2d_Ellipse#

Create an OCP ellipse from a voldmlr Ellipse3D.

Parameters:

ellipse – volmdlr Ellipse3D.

Returns:

OCP Geom_Ellipse.

volmdlr.to_ocp.ellipse3d_to_ocp(ellipse) Geom_Ellipse#

Create an OCP ellipse from a voldmlr Ellipse3D.

Parameters:

ellipse – volmdlr Ellipse3D.

Returns:

OCP Geom_Ellipse.

volmdlr.to_ocp.extrusionsurface_to_ocp(surface) Geom_SurfaceOfLinearExtrusion#

Create an OCP ExtrusionSurface from a voldmlr ExtrsuionSurface3D.

Parameters:

surface – volmdlr ExtrsuionSurface3D.

Returns:

OCP ExtrusionSurface.

volmdlr.to_ocp.frame2d_to_ocp(frame: Frame2D) gp_Ax2d#

Create an OCP Frame2D from a voldmlr Frame2D.

Parameters:

frame – volmdlr Frame2D.

Returns:

OCP Frame2D.

volmdlr.to_ocp.frame3d_to_ocp(frame: Frame3D, right_handed: bool = False) gp_Ax2 | gp_Ax3#

Create an OCP Frame3D from a voldmlr Frame3D.

Parameters:
  • frame – volmdlr Frame3D.

  • right_handed – (Optional) If set to True returns a gp_Ax2, that is right-handed coordinate system. If

set to False (default) returns a gp_Ax3 can be right-handed (“direct sense”) or left-handed (“indirect sense”). :return: OCP Frame3D.

volmdlr.to_ocp.line2d_to_ocp(line) Geom2d_Line#

Create an OCP Line from a voldmlr Line3D.

Parameters:

line – volmdlr Line3D.

Returns:

OCP Geom_Line.

volmdlr.to_ocp.line3d_to_ocp(line) Geom_Line#

Create an OCP Line from a voldmlr Line3D.

Parameters:

line – volmdlr Line3D.

Returns:

OCP Geom_Line.

volmdlr.to_ocp.list_to_tcolgp_array10fpnt(list_of_points: list[Point3D]) TColgp_Array1OfPnt#

Convert list to ocp standard.

volmdlr.to_ocp.list_to_tcolgp_array10fpnt2d(list_of_points: list[Point3D]) TColgp_Array1OfPnt2d#

Convert list to ocp standard. Helper function.

volmdlr.to_ocp.list_to_tcolstd_array10freal(list_of_real: list[int | float]) TColStd_Array1OfReal#

Convert list to ocp standard. Helper function.

volmdlr.to_ocp.list_to_tcolstd_array1ofinteger(list_of_int: list[int]) TColStd_Array1OfInteger#

Convert list to ocp standard. Helper function.

volmdlr.to_ocp.plane_to_ocp(surface) Geom_Plane#

Create an OCP Plane from a voldmlr Plane3D.

Parameters:

surface – volmdlr Plane3D.

Returns:

OCP Plane.

volmdlr.to_ocp.point2d_to_ocp(point2d: Point2D) gp_Pnt2d#

Create an OCP Point2D from a voldmlr Point2D.

Parameters:

point2d – volmdlr Point2D.

Returns:

OCP Point2D

volmdlr.to_ocp.point3d_to_ocp(point: Point3D) gp_Pnt#

Create an OCP Point3D from a voldmlr Point3D.

Parameters:

point – volmdlr Point3D.

Returns:

OCP Point3D

volmdlr.to_ocp.revolutionsurface_to_ocp(surface) Geom_SurfaceOfRevolution#

Create an OCP Geom_SurfaceOfRevolution from a voldmlr RevolutionSurface3D.

Parameters:

surface – volmdlr ExtrsuionSurface3D.

Returns:

OCP ExtrusionSurface.

volmdlr.to_ocp.sphericalsurface_to_ocp(surface) Geom_SphericalSurface#

Create an OCP SphericalSurface from a voldmlr SphericalSurface3D.

Parameters:

surface – volmdlr SphericalSurface3D.

Returns:

OCP SphericalSurface.

volmdlr.to_ocp.toroidalsurface_to_ocp(surface) Geom_ToroidalSurface#

Create an OCP ToroidalSurface from a voldmlr ToroidalSurface3D.

Parameters:

surface – volmdlr ToroidalSurface3D.

Returns:

OCP ToroidalSurface.

volmdlr.to_ocp.vector2d_to_ocp(vector: Vector2D, unit_vector: bool = False) gp_Vec2d#

Create an OCP Vector2D from a voldmlr Vector2D.

Parameters:
  • vector – volmdlr Vector2D.

  • unit_vector – If set to True, returns an OCP.gp.gp_Dir2d object.

Returns:

OCP Vector2D

volmdlr.to_ocp.vector3d_to_ocp(vector: Vector3D, unit_vector: bool = False) gp_Vec#

Create an OCP Vector3D from a voldmlr Vector3D.

Parameters:
  • vector – volmdlr Vector3D.

  • unit_vector – If set to True, returns an OCP.gp.gp_Dir object.

Returns:

OCP Vector3D