---
jupyter:
description: 'planex2d sketches on planes in 3D become OpenCASCADE faces, which can be
extruded, revolved and cut into solids that keep their edge names for meshing and export.'
---
# 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](../../core/conventions.md)).
In this section
## Export
- [To OCC shapes](export.md)
- [Export options](export-options.md)
- [Splines as arcs](splines-as-arcs.md)
## Modeling
- [A C-clamp, step by step](clamp.md)
- [Sketching on and projecting 3D geometry](projecting.md)
- [Lofting sections](loft.md)
- [Lofts with guide curves](guided-loft.md)
## Everything at a glance
| | |
|---|---|
| **Export** | `ToOCCShape()`, `ToOCCFace()`, `ToOCCWire()`, `ToOCCWires()`, with the cleanup options of `Simplify` (see [Export options](export-options.md)) |
| **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](../../core/sketch/placement.md)) |
| **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](../netgen/index.md)) |