Project 10: Feature-Based Modeler (Extrude/Revolve)
Build a feature pipeline that extrudes and revolves sketches into solids.
Project Overview
| Attribute | Value |
|---|---|
| Difficulty | Level 3: Advanced |
| Time Estimate | 3-4 weeks |
| Main Language | C++ |
| Alternative Languages | Rust, C, Python |
| Knowledge Area | Feature-based modeling |
| Tools | Mesh viewer, validation scripts |
| Main Book | “Geometric Modeling” by Michael E. Mortenson |
What you’ll build: A feature pipeline that converts 2D sketches into 3D solids using extrude and revolve operations.
Why it teaches computational geometry: Feature modeling is how real CAD users build parts. This project connects sketches, topology, and solid generation.
Core challenges you’ll face:
- Converting 2D profiles into 3D topology
- Generating side faces and caps consistently
- Handling self-intersections and invalid profiles
Real World Outcome
You will input a 2D profile and generate a valid solid. The output will be a closed mesh or B-Rep that can be visualized.
Example Output:
$ ./feature_model --extrude profile.json --distance 20 --output part.obj
Profile vertices: 16
Generated solid faces: 64
Validation: watertight
Verification steps:
- Visualize the extruded/revolved solid
- Check that caps and side faces are consistent
The Core Question You’re Answering
“How do sketch-based CAD features become real 3D solids?”
This is the bridge between design intent and geometry.
Concepts You Must Understand First
Stop and research these before coding:
- Profile validity
- What makes a sketch suitable for extrusion?
- Book Reference: “Geometric Modeling” by Michael E. Mortenson, Ch. 8
- Sweep and revolve
- How does rotation create surfaces of revolution?
- Book Reference: “Curves and Surfaces for CAGD” by Gerald Farin, Ch. 12
- Topology generation
- How do you create consistent faces and edges from a profile?
- Book Reference: “Geometric Modeling” by Michael E. Mortenson, Ch. 10
Questions to Guide Your Design
- Extrude strategy
- Will you treat profiles as planar polygons or as curves?
- How will you handle holes in profiles?
- Revolve strategy
- How will you handle axis alignment and angle ranges?
- How will you avoid self-intersections?
Thinking Exercise
Revolve Geometry
Take a 2D line segment offset from the axis and revolve it 360 degrees. What shape is produced?
Questions while working:
- How do you represent the resulting surface in a mesh?
- What happens if the profile intersects the axis?
The Interview Questions They’ll Ask
Prepare to answer these:
- “What is feature-based modeling?”
- “How does an extrusion create side faces and caps?”
- “What are common validity checks for sketches?”
- “How do you prevent self-intersection in a revolve?”
- “How do you convert a profile into a watertight solid?”
Hints in Layers
Hint 1: Starting Point Start with simple convex profiles before handling holes.
Hint 2: Next Level Generate side faces by connecting corresponding edges along the sweep.
Hint 3: Technical Details Ensure consistent winding for caps to maintain outward normals.
Hint 4: Tools/Debugging Validate the output mesh for open edges and inverted faces.
Books That Will Help
| Topic | Book | Chapter |
|---|---|---|
| Sweeps and extrusion | “Geometric Modeling” by Michael E. Mortenson | Ch. 8 |
| Surfaces of revolution | “Curves and Surfaces for CAGD” by Gerald Farin | Ch. 12 |
| Solid topology | “Geometric Modeling” by Michael E. Mortenson | Ch. 10 |
Implementation Hints
- Build extrusion first, then add revolve.
- Keep geometry and topology generation separate.
- Validate profile orientation before building solids.
Learning Milestones
- First milestone: You can extrude a simple profile into a solid.
- Second milestone: You can revolve a profile into a closed shape.
- Final milestone: You can explain why feature modeling needs robust checks.