Catalog · How the catalog works
PascalCad
Anyone may press Interesting, signed in or not. It helps others find this project.
README
PascalCad
PascalCad is a Lazarus LCL component for creating, reading, writing and visualizing CAD entities in Free Pascal. It supports solid modeling (boolean operations on triangle meshes), surface modeling (NURBS, Bezier, mesh surfaces), and curve/point primitives.
Inspired by OpenCascade, Rhinoceros, xEagle, and OpenSCad.
Features
- 3D Primitives — Point, Vector, Line, PolyLine, Polygon, Triangle, Circle, Ellipse
- Curve Primitives — B-Spline curves with de Boor basis functions
- Surface Primitives — Bezier surfaces, NURBS surfaces (rational B-spline with weights and knot vectors)
- Solid Primitives — Box, Sphere, Cylinder (each generates a TriangleMesh)
- Triangle Meshes — TTriangleMesh with volume, area, centroid, clone, and solid/non-solid flag
- Solid Modeling — Union, Subtraction, Section (on solid meshes)
- Feature Operations — Extrude, Sweep, Pocket
- Surface Modeling — Trim, PunchHole, ExtendSurface
- Transformations — Scale, Rotate, Translate
- LCL Components — TPascalCadComponent (entity manager), TPascalCadViewport (with mouse orbit/pan/zoom), TPascalCadScripter (scripting support)
- Package — Delivered as a Lazarus package (PascalCad.lpk)
Installation
- Open Lazarus
- Package → Open Package File (.lpk)
- Select
PascalCad.lpk - Click Compile, then Install (or Use → Add to Project)
- The PascalCad, PascalCadViewport, and PascalCadScripter components appear on the component palette
Quick Start
Drop a TPascalCadComponent and a TPascalCadViewport on a form, link the viewport's CadComponent property, then create entities:
CadComponent1.AddBox('Box1',
TPoint3D.Create(0, 0, 0),
TPoint3D.Create(10, 10, 10));Project Structure
Src/
????????? Common/ # Shared constants (PConstants.inc)
????????? CadPrimitives/ # Point, Vector, Line, Triangle, Circle, Ellipse,
??? # PolyLine, Polygon, BSpline, BezierSurface,
??? # NurbsSurface, TriangleMesh, Box, Sphere, Cylinder
????????? SolidModelingOperations/ # Union, Subtraction, Section
????????? FeatureOperations/ # Extrude, Sweep, Pocket
????????? SurfaceModelingOperations/ # SurfaceTrim, PunchHole, ExtendSurface
????????? Transformations/ # Scale, Rotate, Translate
????????? LCLComponents/ # PascalCadComponent, PascalCadViewport, PascalCadScripterDependencies
- Lazarus LCL
- Free Pascal 3.2+ / Lazarus 2.2+ (recommended)
License
MIT

