compas_occt.conversions
¤
Functions:¤
aabb_to_compas
¤
aabb_to_compas(aabb) -> Box
Convert OCC AABB data (cornermin, cornermax) to a COMPAS box.
array1_from_floats1
¤
Construct a one-dimensional float array from a list of floats.
See Also
array1_from_integers1
¤
Construct a one-dimensional integer array from a list of integers.
See Also
array1_from_points1
¤
Construct a one-dimensional point array from a list of points.
See Also
array2_from_floats2
¤
Construct a two-dimensional real array from a list of lists of floats.
See Also
array2_from_points2
¤
Construct a two-dimensional point array from a list of lists of points.
See Also
ax22d_to_compas
¤
Construct a COMPAS frame from OCC ax22d data (point, xaxis, yaxis).
ax2_to_compas
¤
Construct a COMPAS frame from OCC ax2 data (point, xaxis, yaxis).
ax3_to_compas
¤
Construct a COMPAS frame from OCC ax3 data (point, xaxis, yaxis).
axis2d_to_compas
¤
Convert OCC 2D axis data (location, direction) to a (Point, Vector) tuple.
axis2d_to_compas_vector
¤
Construct a COMPAS vector from OCC 2D axis data (location, direction).
axis_to_compas
¤
Convert OCC axis data (location, direction) to a (Point, Vector) tuple.
axis_to_compas_vector
¤
Construct a COMPAS vector from OCC axis data (location, direction).
axis_to_occ
¤
Convert a COMPAS (point, vector) to OCC axis data (location, direction).
bezier_to_compas
¤
bezier_to_compas(points) -> Bezier
Construct a COMPAS Bezier curve from a list of control points.
bspline_to_compas
¤
bspline_to_compas(bspline) -> NurbsCurve
Construct a COMPAS NURBS curve from an OCC B-spline curve handle (GeomCurve).
circle2d_to_compas
¤
Construct a COMPAS circle from OCC 2D circle data (frame, radius).
circle_to_compas
¤
Construct a COMPAS circle from OCC circle data (frame, radius).
circle_to_occ
¤
Convert a COMPAS circle to OCC circle data (frame, radius).
circle_to_occ2d
¤
Convert a COMPAS circle to OCC 2D circle data (frame, radius).
compas_mesh_to_occ_shell
¤
compas_mesh_to_occ_shell(mesh: Mesh)
Convert a general COMPAS mesh to an OCC shell (Shape).
compas_quadmesh_to_occ_shell
¤
compas_quadmesh_to_occ_shell(mesh: Mesh)
Convert a COMPAS quad mesh to an OCC shell (Shape).
Raises:
-
ValueError–If the input mesh is not a quad mesh.
compas_transformation_to_trsf
¤
compas_transformation_to_trsf(matrix: Transformation) -> list[float]
Convert a COMPAS transformation to OCC transformation data.
The OCC backend builds a gp_Trsf from the row-major list of the first 12 values
of the 4x4 matrix (SetValues). gp_Trsf itself never crosses into Python, so
this returns that 12-float list, which the C++ transform functions accept directly.
Parameters:
-
matrix(Transformation) –A COMPAS transformation.
Returns:
compas_trimesh_to_occ_shell
¤
compas_trimesh_to_occ_shell(mesh: Mesh)
Convert a COMPAS triangle mesh to an OCC shell (Shape).
Raises:
-
ValueError–If the mesh is not a triangle mesh.
cone_to_occ
¤
Convert a COMPAS cone to OCC cone data (frame, radius, height).
cylinder_to_compas
¤
Convert OCC cylinder data (frame, radius) to a COMPAS cylinder.
cylinder_to_occ
¤
Convert a COMPAS cylinder to OCC cylinder data (frame, radius).
direction2d_to_compas
¤
Construct a COMPAS vector from OCC 2D direction data (x, y).
direction_to_compas
¤
Construct a COMPAS vector from OCC direction data (x, y, z).
direction_to_occ
¤
Convert a COMPAS vector to OCC direction data (x, y, z).
direction_to_occ2d
¤
Convert a COMPAS vector to OCC 2D direction data (x, y).
ellipse2d_to_compas
¤
Construct a COMPAS ellipse from OCC 2D ellipse data (frame, major, minor).
ellipse_to_compas
¤
Construct a COMPAS ellipse from OCC ellipse data (frame, major, minor).
ellipse_to_occ
¤
Convert a COMPAS ellipse to OCC ellipse data (frame, major, minor).
ellipse_to_occ2d
¤
Convert a COMPAS ellipse to OCC 2D ellipse data (frame, major, minor).
floats2_from_array2
¤
Construct a list of lists of floats from a two-dimensional array of real numbers.
See Also
frame_to_occ_ax2
¤
Convert a COMPAS frame to OCC ax2 data (point, xaxis, yaxis).
frame_to_occ_ax22d
¤
Convert a COMPAS frame to OCC ax22d data (point, xaxis, yaxis) (2D).
frame_to_occ_ax3
¤
Convert a COMPAS frame to OCC ax3 data (point, xaxis, yaxis).
harray1_from_points1
¤
Construct a handled one-dimensional point array from a list of points.
See Also
hyperbola2d_to_compas
¤
hyperbola2d_to_compas(hypr) -> Hyperbola
Construct a COMPAS hyperbola from OCC 2D hyperbola data (frame, major, minor).
hyperbola_to_compas
¤
hyperbola_to_compas(hypr) -> Hyperbola
Construct a COMPAS hyperbola from OCC hyperbola data (frame, major, minor).
line2d_to_compas
¤
Convert OCC 2D line data (location, direction) to a COMPAS line.
line_to_compas
¤
Convert OCC line data (location, direction) to a COMPAS line.
line_to_occ
¤
Convert a COMPAS line to OCC line data (location, direction).
line_to_occ2d
¤
Convert a COMPAS line to OCC 2D line data (location, direction).
location_to_compas
¤
location_to_compas(matrix) -> Frame
Construct a COMPAS frame from an OCC location's 3x4 row-major matrix.
ngon_to_face
¤
Convert an ngon to a BRep face with a best-fit surface (Shape).
obb_to_compas
¤
obb_to_compas(obb) -> Box
Convert OCC OBB data (frame, xhsize, yhsize, zhsize) to a COMPAS box.
parabola2d_to_compas
¤
parabola2d_to_compas(parab) -> Parabola
Construct a COMPAS parabola from OCC 2D parabola data (frame, focal).
parabola_to_compas
¤
parabola_to_compas(parab) -> Parabola
Construct a COMPAS parabola from OCC parabola data (frame, focal).
plane_to_compas
¤
Convert OCC plane data (point, normal) to a COMPAS plane.
plane_to_occ
¤
Convert a COMPAS plane to OCC plane data (point, normal).
plane_to_occ_ax2
¤
Convert a COMPAS plane to OCC ax2 data (point, normal).
plane_to_occ_ax3
¤
Convert a COMPAS plane to OCC ax3 data (point, normal).
point2d_to_compas
¤
Construct a COMPAS point from OCC 2D point data (x, y).
point_to_compas
¤
Construct a COMPAS point from OCC point data (x, y, z).
point_to_occ
¤
Convert a COMPAS point to OCC point data (x, y, z).
point_to_occ2d
¤
Convert a COMPAS point to OCC 2D point data (x, y).
points1_from_array1
¤
Construct a list of points from a one-dimensional point array.
See Also
points2_from_array2
¤
Construct a list of lists of points from a two-dimensional point array.
See Also
quad_to_face
¤
Convert a quad (4 points) to a BRep face with a ruled surface (Shape).
Raises:
-
ValueError–If the number of points is not 4.
sphere_to_compas
¤
Convert OCC sphere data (frame, radius) to a COMPAS sphere.
sphere_to_occ
¤
Convert a COMPAS sphere to OCC sphere data (frame, radius).
torus_to_occ
¤
Convert a COMPAS torus to OCC torus data (frame, radius_axis, radius_pipe).
triangle_to_face
¤
Convert a triangle (3 points) to a BRep face (Shape).
Raises:
-
ValueError–If the number of points is not 3.
vector2d_to_compas
¤
Construct a COMPAS vector from OCC 2D vector data (x, y).
vector_to_compas
¤
Construct a COMPAS vector from OCC vector data (x, y, z).
vector_to_occ
¤
Convert a COMPAS vector to OCC vector data (x, y, z).