⚠️ caution
This project is in early development.
Geolis
Geolis is a CAD kernel written in Rust. It provides geometry representation using NURBS curves and surfaces, along with B-rep structures for solid modeling.
Features
- NURBS Curves & Surfaces: Mathematically precise freeform geometry representation
- B-rep Structure: Topology management with Vertex, Edge, Face, Shell, and Solid
- Boolean Operations: Solid operations including Union, Difference, and Intersection
- Fast & Safe: Built in Rust, can run in browsers via WebAssembly
Installation
[dependencies]
geolis = "0.1"
Capabilities
NURBS Curves
Generation
| Function | Description |
|---|
NurbsCurve::new | Create curve from control points, knots, and weights |
NurbsCurve::interpolate | Generate interpolating curve through point sequence |
NurbsCurve::from_arc | Create NURBS curve from arc |
NurbsCurve::from_circle | Create NURBS curve from circle |
NurbsCurve::periodic | Create closed periodic curve |
Evaluation
| Function | Description |
|---|
evaluate | Get point at parameter value |
derivative | Get nth derivative vector |
tangent | Tangent vector (normalized) |
curvature | Curvature value |
curvature_vector | Curvature vector |
torsion | Torsion (3D curves) |
Analysis
| Function | Description |
|---|
closest_point | Find closest point on curve to given point |
arc_length | Calculate arc length |
parameter_at_length | Inverse: get parameter from arc length |
divide_by_count | Get equally divided points |
divide_by_length | Divide by equal arc length |
Operations
| Function | Description |
|---|
split | Split at specified parameter |
trim | Trim to range |
reverse | Reverse direction |
join | Join two curves |
offset | Generate offset curve |
insert_knot | Knot insertion (Boehm algorithm) |
elevate_degree | Degree elevation |
Curve-Curve Operations
| Function | Description |
|---|
intersect | Intersection points between curves |
fillet | Generate fillet curve |
NURBS Surfaces
Generation
| Function | Description |
|---|
NurbsSurface::new | Create surface from control point grid |
NurbsSurface::extrude | Extrude curve to create surface |
NurbsSurface::loft | Create surface from multiple curves |
NurbsSurface::revolve | Revolve curve to create surface |
NurbsSurface::sweep | Sweep cross-section along rail curve |
NurbsSurface::ruled | Ruled surface between two curves |
NurbsSurface::from_sphere | Sphere surface |
NurbsSurface::from_cylinder | Cylinder surface |
NurbsSurface::from_cone | Cone surface |
NurbsSurface::from_torus | Torus surface |
Evaluation
| Function | Description |
|---|
evaluate | Get point at (u, v) parameters |
normal | Normal vector |
partial_derivative | Partial derivatives |
gaussian_curvature | Gaussian curvature |
mean_curvature | Mean curvature |
principal_curvatures | Principal curvatures |
| Function | Description |
|---|
isocurve_u | Isocurve at fixed u |
isocurve_v | Isocurve at fixed v |
boundary_curves | Boundary curves (4 edges) |
Operations
| Function | Description |
|---|
trim | Trim surface with trim curves |
split_u / split_v | Split at specified parameter |
reverse_u / reverse_v | Reverse direction |
transpose | Swap u and v directions |
Surface-Surface Operations
| Function | Description |
|---|
intersect_surface | Intersection curve between surfaces |
intersect_curve | Intersection points of surface and curve |
B-rep Structure
Topology Elements
| Element | Description |
|---|
Vertex | Vertex (3D coordinate) |
Edge | Edge (curve + start/end vertices) |
Loop | Boundary loop (chain of Edges) |
Face | Face (surface + boundary loops) |
Shell | Shell (collection of Faces) |
Solid | Solid (collection of Shells) |
Topology Operations
| Function | Description |
|---|
adjacent_faces | Faces adjacent to specified face |
adjacent_edges | Edges connected to specified vertex |
is_manifold | Check if manifold |
is_closed | Check if shell is closed |
euler_characteristic | Euler characteristic |
Boolean Operations
| Function | Description |
|---|
union | Union |
difference | Difference (hole creation) |
intersection | Intersection (common part) |
Tessellation
| Function | Description |
|---|
tessellate | Convert surface to mesh |
TessellationOptions::tolerance | Tolerance |
TessellationOptions::adaptive | Adaptive subdivision based on curvature |
TessellationOptions::max_divisions | Maximum divisions |
Module Structure
geolis
├── geolis-math # Math utilities
├── geolis-curve # NURBS curves
├── geolis-surface # NURBS surfaces
├── geolis-topology # B-rep structure
├── geolis-boolean # Boolean operations
├── geolis-mesh # Tessellation
└── geolis-io # File I/O
License
MIT License
Links