Skip to content

Latest commit

 

History

History

PyOCC Examples

Runnable examples demonstrating the PyOCC API. Each script is self-contained and prints its results to the console. Run them with the pyocc conda environment active (see the installation guide):

mamba activate pyocc
python examples/01_basic_shapes.py
Script Demonstrates
01_basic_shapes.py Creating primitives, geometric properties (volume, area, centre of mass, bounding box), Boolean operations, and transformations
02_geometry_analysis.py Per-face surface evaluation (points & normals), closest-point queries, and curve (edge) analysis
03_uvgrid_sampling.py Uniform UV-grid sampling of faces and edges via UniformGrid, sample_face_uniformly, and sample_edge_uniformly
04_file_io.py Writing and reading STEP, STL, and native BREP files
05_topology_graph.py Building face- and vertex-adjacency graphs (NetworkX) and inspecting their connectivity

All scripts are exercised the same way you'd run them here, so they double as a quick smoke test of the core API.