Tetrahelix modeling and generative rule based automation ?
-
Is there any simple way to use c4d to create a tetrahelix from tetrahedron objects stacked and with certain changeable rules ? I wish to create some type of shape-grammar that can generate regular tetrahedron constructions. Any hints or pointers would be greatly appreciated!
-
Hello @user,
Welcome to the Plugin Café forum and the Cinema 4D development community, it is great to have you with us!
Getting Started
Before creating your next postings, we would recommend making yourself accustomed with our Forum and Support Guidelines, as they line out details about the Maxon SDK Group support procedures. Of special importance are:
- Support Procedures: Scope of Support: Lines out the things we will do and what we will not do.
- Support Procedures: Confidential Data: Most questions should be accompanied by code but code cannot always be shared publicly. This section explains how to share code confidentially with Maxon.
- Forum Structure and Features: Lines out how the forum works.
- Structure of a Question: Lines out how to ask a good technical question. It is not mandatory to follow this exactly, but you should follow the idea of keeping things short and mentioning your primary question in a clear manner.
About your First Question
You posted in the right forum here, as this mostly is an off-topic question. It is also out of scope of support in this extremely broad form. I am also unsure if you actually are looking for a Python/C++ API based solution. Something like this could also be done with Xpresso/Scene Nodes; or in the case of Xpresso an Xpresso/Python combination. But I personally would not really bother with doing that though.
If you want to define a formal language, your shape grammar, I would use one of the common grammar definition and parsing tools, e.g. PLY is a popular library to lex custom grammars. You could of course also go big and use something like ANTLR, or go small and just use the standard library. I would however not recommend the last option.
When you then implemented parsing an expression in your formal grammar into an AST, actually constructing the geometry for that with Python should be fairly easy. I would invite you to then come back and ask a new question for how to do that (given that you did choose to take this path). The complexities of that last step of course depend also on how complex your grammar is, "tetrahelix" can mean a lot.
Cheers,
Ferdinand