Files
metabuilder/cadquerywrapper/examples/Ex012_Creating_Workplanes_on_Faces.py
johndoe6345789 a8144a5903 feat: Add CadQuery wrapper library for parametric CAD modeling
Python wrapper around CadQuery for simplified 3D CAD operations with
clean API for creating shapes, performing boolean operations, and
exporting to various formats.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-21 17:22:38 +00:00

17 lines
625 B
Python

import cadquery as cq
# 1. Establishes a workplane that an object can be built on.
# 1a. Uses the named plane orientation "front" to define the workplane, meaning
# that the positive Z direction is "up", and the negative Z direction
# is "down".
# 2. Creates a 3D box that will have a hole placed in it later.
result = cq.Workplane("front").box(2, 3, 0.5)
# 3. Find the top-most face with the >Z max selector.
# 3a. Establish a new workplane to build geometry on.
# 3b. Create a hole down into the box.
result = result.faces(">Z").workplane().hole(0.5)
# Displays the result of this script
show_object(result)