6 posts / 0 new
Last post
ForumImport
Offline
Last seen: 9 years 9 months ago
Joined: 09/22/2009 - 18:47
creating parametric objects with python

I'm looking to create somewhat complicated parametric "building blocks" of construction objects. Blender was somewhat limited in this regard, and K-3D was recommended. After looking through the wiki information and playing around with the OS X install, I'm quite impressed with K-3D, but I'd like to know the community's thoughts on what I'm trying to achieve.
I want to:
- create parametric objects using python, which could be loaded into K-3D, just like other 3D objects
- these objects will have gui 'toggles' to control python functions/settings
- objects should be 'locked down': allowing only certain translations/rotations, etc.
- be able to group these objects into super-objects, which would have their own logic/settings
- connect via python to an external data source (socket, db, etc.) for default settings/other data
- use python to manipulate and export raw quantities as csv
Specifically, I will start off with light gauge steel profiles as building components, which the user would be able to move, rotate, and stretch on only one axis, as well as toggle various settings per object.
Is this possible with K-3D? Thanks for your help!

ForumImport
Offline
Last seen: 9 years 9 months ago
Joined: 09/22/2009 - 18:47
creating parametric objects with python
ForumImport
Offline
Last seen: 9 years 9 months ago
Joined: 09/22/2009 - 18:47
creating parametric objects with python

Hi dsmatthews,
Thanks for replying. I'm imagining a 3d object, which could be placed in the viewport like the QuadricCylinder. It would have its own logic & attributes, all written in python as an plugin (correct terminology?) to a K-3D document. I'm reading the wiki sections on python scripting & plugins, and it seems possible, but I'd like confirmation.
Thanks!
PS: would this link help? I get a 404:
http://www.k-3d.com/docs/epydoc
EDIT:
Got it, that should be ".org". This wiki link is wrong:
http://www.k-3d.org/wiki/Python#Documentation

ForumImport
Offline
Last seen: 9 years 9 months ago
Joined: 09/22/2009 - 18:47
creating parametric objects with python

I fixed the wiki link.
Yes the epydoc shows that the API is all script-able with python.
What you are wanting to do is something I have been interested in for a long time and if you look in my to-do list I was looking at even having a python based spreadsheet for the parameters http://www.k-3d.org/wiki/User:Dsmatthews
As things stand Tim has been doing a lot of GUI changes that may be relevant to you and I am no longer up to date with the status of what is a feature and what is a still request so I'll have to defer to Tim for any of the details regarding the do-ability of scripted metaobjects.

ForumImport
Offline
Last seen: 9 years 9 months ago
Joined: 09/22/2009 - 18:47
creating parametric objects with python

Let me ask a different way. As I understand, from browsing the docs:

QuadricCylinder is a 3D parametric plugin, correct?

According to the docs, it is possible to create plugins using python scripts, yes?

Is it possible to create a plugin just like QuadricCylinder using a python script? If so, is there an example/tutorial?

I looked at the code inside "create_polyhedron.py", but it doesn't show how to program or display user configurable options, such as Radius, Sweep Angle, etc.
EDIT:
Sorry, I didn't see your post before replying. Thanks for the link! Something like Sketchup's "Dynamic Components" is exactly what I had in mind. So to be clear, this is currently possible with K-3D?

ForumImport
Offline
Last seen: 9 years 9 months ago
Joined: 09/22/2009 - 18:47
creating parametric objects with python

K-3D provides a broad set of common geometric primitives, see
http://www.k-3d.org/wiki/Geometric_Primitive_Design
for the complete list. Then there are visualization pipeline sources that create instances of those primitives. See
http://www.k-3d.org/wiki/Visualization_Pipeline
for the details. Finally, because we support programmable sources, it's possible to define your own primitive types at runtime. See the whitepaper at
http://developer.k-3d.org/documentation
Depending on your specific use-case, any or all of these options might come into play for you.
Cheers,
Tim

Log in or register to post comments