Implemented OpenSCAD support to models in STEP format. - #120
Open
codex826 wants to merge 4 commits into
Open
Conversation
Member
|
I'm not sure what this is targeting, it references issue #111 but does not match with the topic of that issue. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request: Add OpenSCAD Support for Exporting Models in STEP Format
Issue no: #111
🚀 Overview
This PR introduces the foundational groundwork for exporting OpenSCAD models to the STEP (ISO-10303-21 AP214) format. Unlike the traditional approach of exporting a single rendered mesh, this implementation provides a modular geometry engine and a faceted B-Rep writer capable of preserving individual solid structures within a single export file.
This work fulfills the GSoC 3D-CAD project objective to simplify workflows for CNC manufacturing and electronics design (e.g., KiCAD integration) by removing the need for external STL-to-STEP conversion tools.
🏗 Solution Implementation
1. Research & Analysis
openscad-parserfor AST processing combined with a custom-built B-Rep generation engine. This avoids heavy external dependencies while ensuring full control over the STEP entity graph.FACETED_BREPas the optimal initial target for robust faceted geometry exchange between OpenSCAD and tools like KiCAD or FreeCAD.2. Core Implementation (
src/)geometry.ts): Implements 3D math (Vectors, Matrix4) and mesh-level CSG operations.cube,sphere,cylinder.union,difference,intersection.linear_extrudewith twist and scale support.step-exporter.ts): Converts internal Solid geometry into valid ISO-10303-21 STEP entities (CLOSED_SHELL,FACE_SURFACE,POLY_LOOP).step-evaluator.ts): A tree-walking interpreter that translates OpenSCAD code (modules, functions, loops) into geometry primitives.3. Integrated Tooling
step-validator.ts): Ensures generated files have no dangling references and follow the STEP structural specification.cli.ts): A standalone tool for batch conversion and validation.🛠 Tech Stack
openscad-parserassert.🧪 Testing & Verification
We have implemented a comprehensive test suite in
src/tests/that verifies:🔮 Future Aspects & Advanced Models
The current focus was on building the "ground work" for detailed models:
ADVANCED_BREP(smooth surfaces/NURBS) in the future by extending theFacedefinition to support analytic surfaces.Created as part of the GSoC 3D-CAD initiative.
Pull Request: Add OpenSCAD Support for Exporting Models in STEP Format
🚀 Overview
This PR introduces the foundational groundwork for exporting OpenSCAD models to the STEP (ISO-10303-21 AP214) format. Unlike the traditional approach of exporting a single rendered mesh, this implementation provides a modular geometry engine and a faceted B-Rep writer capable of preserving individual solid structures within a single export file.
This work fulfills the GSoC 3D-CAD project objective to simplify workflows for CNC manufacturing and electronics design (e.g., KiCAD integration) by removing the need for external STL-to-STEP conversion tools.
🏗 Solution Implementation
1. Research & Analysis
openscad-parserfor AST processing combined with a custom-built B-Rep generation engine. This avoids heavy external dependencies while ensuring full control over the STEP entity graph.FACETED_BREPas the optimal initial target for robust faceted geometry exchange between OpenSCAD and tools like KiCAD or FreeCAD.2. Core Implementation (
src/)geometry.ts): Implements 3D math (Vectors, Matrix4) and mesh-level CSG operations.cube,sphere,cylinder.union,difference,intersection.linear_extrudewith twist and scale support.step-exporter.ts): Converts internal Solid geometry into valid ISO-10303-21 STEP entities (CLOSED_SHELL,FACE_SURFACE,POLY_LOOP).step-evaluator.ts): A tree-walking interpreter that translates OpenSCAD code (modules, functions, loops) into geometry primitives.3. Integrated Tooling
step-validator.ts): Ensures generated files have no dangling references and follow the STEP structural specification.cli.ts): A standalone tool for batch conversion and validation.🛠 Tech Stack
openscad-parserassert.🧪 Testing & Verification
I have implemented a comprehensive test suite in
src/tests/that verifies:🔮 Future Aspects & Advanced Models
The current focus was on building the "ground work" for detailed models:
ADVANCED_BREP(smooth surfaces/NURBS) in the future by extending theFacedefinition to support analytic surfaces.Created as part of the GSoC 3D-CAD initiative.