Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Named groups, or other ways to identify components. #5126

Open
julianstirling opened this issue May 8, 2024 · 0 comments
Open

Named groups, or other ways to identify components. #5126

julianstirling opened this issue May 8, 2024 · 0 comments

Comments

@julianstirling
Copy link

Is your feature request related to a problem? Please describe.
We generate assembly documentation from OpenSCAD. Each component is rendered in OpenSCAD, and then we have OpenSCAD assemblies.

If we want to make a coloured 3D model to share we have a script that can read OpenSCAD CSG files. The script runs openscad on each colour group. The resulting STL is created read into python and converted to a GTLF mesh. This allows us to share colour 3D models generated in OpenSCAD.

The next stage of this would be to allow the user to toggle the visibility components/ sub assemblies in an online 3D viewer. For this we would need to have the information of which code corresponds to which components passed through to the CSG file.

Some sort of named group system would allow the main OpenSCAD editor to also display a tree view and to allow a user to toggle visibility of elements without needing to add * and ! into their code.

Describe the solution you'd like

CSG already uses groups. It is possible to add these groups directly into OpenSCAD code. If group had an optional argument for a name that was passed through to the CSG file this would allow further processing in separate tools. It could also be used by the OpenSCAD editor to create a tree view.

For example, the following would be possible:

group("Top assembly"){
    group("Lid"){
        /*Lots of code*/
    }
    group("Hinge"){
            /*Lots of code*/
    }
    group("Screws"){
            /*Lots of code*/
    }
}
group("Bottom assembly"){
    group("Case"){
        /*Lots of code*/
    }
    group("Gubbins"){
            /*Lots of code*/
    }
    group("Fixings"){
            /*Lots of code*/
    }
}

I feel this would unlock a number of further features to make it easier to design assemblies and complex components in OpenSCAD

Describe alternatives you've considered
I did try to echo at the start and end of each component as a hacky solution, but echos are not passed to the CSG.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant