Skip to content

Adds support for BSpline curves, extruded linearly, and revolved#20

Open
etjones wants to merge 12 commits intoFormlabs:masterfrom
etjones:feature/surface_linear_extrusion_triangulation
Open

Adds support for BSpline curves, extruded linearly, and revolved#20
etjones wants to merge 12 commits intoFormlabs:masterfrom
etjones:feature/surface_linear_extrusion_triangulation

Conversation

@etjones
Copy link

@etjones etjones commented Dec 15, 2025

Previously, Foxtrot ignored BSpline curves that were extruded or revolved. This PR adds support & testing for BSplines with both actions. Compare the examples I added:

In current Foxtrot, the curved surfaces on both files don't appear at all. Those surfaces render correctly with this PR

(Note: this was built on top of PR #19. Shouldn't be any functionality required there, but that would be best to apply first)

- Add #![allow(dead_code)] at module level for AST struct fields
  (these are meant for library consumers)
- Fix lifetime elision warnings by adding explicit '_ annotations
  to IResult type signatures throughout parse.rs
- Update alias macro to handle lifetime and non-lifetime cases separately
- Fix SimpleId::parse, Expression::parse, and SimpleExpression::parse
  to use explicit lifetime annotations
- Update nom dependency in express/Cargo.toml and step/Cargo.toml
- Fix fold_many0/fold_many1 API changes: init parameter changed from
  value to closure in nom 7
  - binary_literal: 0 -> || 0
  - encoded_string_literal: String::new() -> String::new
  - simple_string_literal: String::new() -> String::new

All 49 tests pass.
- Update nalgebra-glm in gui/Cargo.toml, nurbs/Cargo.toml, triangulate/Cargo.toml
- This also upgrades nalgebra from 0.27.1 to 0.34.1
- Resolves the future-incompatibility warning about trailing semicolons in macros

No code changes required - the API is backwards compatible for our usage.
All 49 tests pass.
- Add ExtrusionCurve enum supporting BSpline, NURBS, and Line variants
- Implement curve sampling and perpendicular projection for closest point finding
- Add Newton-Raphson iteration for closest_u_perp on curved extrusions
- Implement Surface::LinearExtrusion with project() and normal() methods
- Add support for SURFACE_OF_LINEAR_EXTRUSION in triangulation pipeline
- Extract extrusion direction and curve from STEP entities
- Add spline_revolve.step example demonstrating SURFACE_OF_REVOLUTION with B-spline curve
- Implement Surface::Revolution variant with axis, curve, and transformation matrices
- Add ExtrusionCurve::closest_u() for 3D point projection (non-perpendicular)
- Implement closest_u_newton_3d() with Newton-Raphson iteration for curved surfaces
- Add unwrap_theta_in_place() helper to handle angle wrapping in revolution surfaces
- Implement project
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant