[Closed] Could any one write a script: to create a sponge
Hi
I want to create a 3d sponge with Max, a sponge with fiber inside and outside. Howerever I foud this was not easy to crete this kind solid fiberous structure by 3ds max. So could any one write a script to create a 3d sponge-like structure? I have idea: What if we can create a dot flying around a define space, convert the trace of the dot to the geometry of the fiberous structure. I hope you see what I mean. But how?
Regards
Hammer
Hi Hammer,
hope this helps:
sponge =SplineShape pos:[0,0,0]
addNewSpline sponge
-- -
spongeWidth=100
spongeHeight=100
spongeLength=100
-- -
maxIterations=1000
for i=1 to maxIterations do (
addKnot sponge 1 #corner #curve [(random (-spongeWidth/2) spongeWidth/2),(random (-spongeLength/2) spongeLength/2), (random (-spongeHeight/2) spongeHeight/2)]
)
updateShape sponge
sponge.baseobject.renderable=true
sponge.name="sponge"
Georg
Wow! very nice!
I really suggest you (or please you) add more fuctions to it (1)select an target object (2)set the spline with interpolation not only a stright line. And maybe post this great script to http://www.scriptspot.com/start.htm
Hello Hammer,
thanks again for this idea!
I found some time to wrap the code with a gui and made a macroscript.
You can download it here:
http://proforma.preset.de/cgtalk/scripts/rdg_spongeSynth.ms
Next task is to fill arbitrary objects with splines.
Georg
Maybe because I am not a native speaker ?
thing-o-string is the new name …
proforma.preset.de/cgtalk/scripts/rdg_object_thing-o-string.ms
feat. the frustrum-o-sting
the next release needs some rewrite using my newly learned maxscript OOP techniques.
Georg
Whenever I try and run the script in max5 or 7 I get an error that says:
Unknown property “render_renderable” in <Deleted Scene Node>.
It stops at this line towards the end:
sponge.render_renderable=true
Don’t have time to poke in the script right now to see what it’s doing, can you reproduce the error?
- Neil
sorry neil,
this is because I used the max 7.5 features of splines.
I will implement a fallback try()catch() to get it running with earlier versions of max.
or just use the old syntax
Here is the backward-compatible version:
proforma.preset.de/cgtalk/scripts/rdg_object_thing-o-string.ms
Georg