OpenCASCADE

A planex2d object lies on a plane in 3D, so its faces and wires become OpenCASCADE shapes as they are: exact lines, arcs, full circles and B-splines with shared vertices. They can be extruded, revolved and lofted into solids or cut from solids, and a sketch can be drawn on the face of a solid with the solid’s edges projected into it. Names, colors and mesh sizes travel with the edges and faces into the solid, where netgen reads them as boundaries, materials and mesh sizes. The export can clean up the geometry on the way out, fit splines, and write arcs for tools that accept nothing else. It needs netgen’s OpenCASCADE (pip install netgen-mesher). Planes are px.Plane objects on these pages; every plane argument also takes netgen’s occ.Axes, so existing netgen code can pass its axes unchanged (see API conventions).

In this section

Export

Modeling

Everything at a glance

Export

ToOCCShape(), ToOCCFace(), ToOCCWire(), ToOCCWires(), with the cleanup options of Simplify (see Export options)

Solids

px.Pad(profile, length) and px.Pocket(target, profile, length), with length2, dir, reverse and until; OpenCASCADE’s own operations on the exported shapes, such as Extrude and occ.ThruSections

Sketching on solids

px.QuickSketch(face) and px.Sketch(face) on a planar face, sk.Project(edge) for its edges as references (see Placing a sketch)

Back into planex2d

px.FromOCC(shape or file), px.Project(shape, plane), px.Intersect3d(plane, shape)

Drawing

px.Plot3d(objects) in 3D, px.Plot(shape, plane) for a section

Meshing

px.OCCGeometry(face) for netgen (see netgen and NGSolve)