discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

Best practices for OpenSCAD + Blender

N
neri-engineering
Sat, Oct 15, 2022 1:30 AM

I am beginning to delve into the area of Blender functionality for making animation visuals which are obviously not in the arena of what OpenSCAD was designed/intended to do. OpenSCAD has filled an extremely valuable role, but I'd like to push the envelope a little bit.

I was wondering about best practices.

Here is a scenario that I am imagining. I like to make my animations in OpenSCAD, including the compression of springs, the rotation/translation of parts, the appearance of parts one by one, assembly videos, etc.

One strategy one could employ is, for every frame of the animation, generate a solid in OpenSCAD (e.g. STL), import that into Blender, and render that with a certain lighting model, certain texture/color, and certain camera angle etc. However this would be done programmatically, and if we wanted different colored/textured parts, then the different "individual" pieces of the STL exported from OpenSCAD would at least need something like a label, per "piece", e.g. "Label for shiny metallic titanium surface", or "label for flat carbon piece", because you would not want to employ a human to sort the combined STL file to isolate the individual pieces, in order to assign a different texture to each piece.

Another strategy is to make the entire animation in Blender with individual STL pieces generated from OpenSCAD, but this is disagreeable for many reasons, we'd be re-doing the animation in Blender when it was already done in OpenSCAD, and the offsets, clearances, distances etc would need to be "re-defined" in Blender to create the correct animation distances and rotations. In other words not only lots of work, but also duplicate work, which is not ideal. If there are complex formulas in OpenSCAD for part movement then those would need to be re-defined in Blender. Ugly.

I'm simply wondering, before becoming an expert in Blender, about what strategies high-level engineering experts employ when combining OpenSCAD and Blender to make awesome mechanical engineering videos, assembly or functioning. My gut feel tells me that some sort of labeling strategy within OpenSCAD would work best, but I have not given the matter any further thought. I realize that color is a per-face attribute, in other words a piece can have faces of different colors in the prototype view.

Perhaps there is a format other than STL that supports some for of labeling, and perhaps OpenSCAD is able to label the individual pieces of a complex animation, and perhaps Blender can be configured to act on labels.

Regards,
Nerius

Sent with Proton Mail secure email.

I am beginning to delve into the area of Blender functionality for making animation visuals which are obviously not in the arena of what OpenSCAD was designed/intended to do. OpenSCAD has filled an extremely valuable role, but I'd like to push the envelope a little bit. I was wondering about best practices. Here is a scenario that I am imagining. I like to make my animations in OpenSCAD, including the compression of springs, the rotation/translation of parts, the appearance of parts one by one, assembly videos, etc. One strategy one could employ is, for every frame of the animation, generate a solid in OpenSCAD (e.g. STL), import that into Blender, and render that with a certain lighting model, certain texture/color, and certain camera angle etc. However this would be done programmatically, and if we wanted different colored/textured parts, then the different "individual" pieces of the STL exported from OpenSCAD would at least need something like a label, per "piece", e.g. "Label for shiny metallic titanium surface", or "label for flat carbon piece", because you would not want to employ a human to sort the combined STL file to isolate the individual pieces, in order to assign a different texture to each piece. Another strategy is to make the entire animation in Blender with individual STL pieces generated from OpenSCAD, but this is disagreeable for many reasons, we'd be re-doing the animation in Blender when it was already done in OpenSCAD, and the offsets, clearances, distances etc would need to be "re-defined" in Blender to create the correct animation distances and rotations. In other words not only lots of work, but also duplicate work, which is not ideal. If there are complex formulas in OpenSCAD for part movement then those would need to be re-defined in Blender. Ugly. I'm simply wondering, before becoming an expert in Blender, about what strategies high-level engineering experts employ when combining OpenSCAD and Blender to make awesome mechanical engineering videos, assembly or functioning. My gut feel tells me that some sort of labeling strategy within OpenSCAD would work best, but I have not given the matter any further thought. I realize that color is a per-face attribute, in other words a piece can have faces of different colors in the prototype view. Perhaps there is a format other than STL that supports some for of labeling, and perhaps OpenSCAD is able to label the individual pieces of a complex animation, and perhaps Blender can be configured to act on labels. Regards, Nerius Sent with [Proton Mail](https://proton.me/) secure email.