Enter this
poly = selection[1]
dicke = 0.5
for i=1 to poly.numfaces collect
(
vv = polyop.getfaceverts poly i
hair = splineShape ()
addnewspline hair
addknot hair 1 #corner #line (polyop.getVert $ vv[1])
addknot hair 1 #corner #line (polyop.getVert $ vv[2])
addknot hair 1 #corner #line (polyop.getVert $ vv[3])
close hair 1
updateShape hair
hair.name = "triangle " + i as string
addModifier hair(extrude amount:dicke segs:1)
)
select a poly object with a few faces and run the script. It will create a shell made of triangles around your object. Tested with 3dsmax7.
Issue is though, that there are
a) always some triangles missing
b) always different triangles missing
Why is that?
Replies
If you want to make a shell, there's a shell modifier already which is pretty efficient.
How would you change it then?
it works fine if you triangulate the mesh first so Noors is probably correct.
the bad news is that if you run it on a mesh with about 1600 triangles it hangs in 2012 (posh i7 with 8gb)
if you're planning on greebling or similar you need to set the orientations of the splines to match face normals as the extrude modifiers are working in world space
if you're not planning on greebling then you could simply explode faces to elements and add a push rather than needing to draw out your splines
in fact im pretty sure you could just draw triangles and dispense with the whole spline thing altogether
Select the object's vertices (Ctrl+A)
Press connect.
Run the script.
:thumbdown:
There's nothing wrong with your code because it clearly runs and does what is asked of it.
It's possible there's a problem with your approach and you've had suggestions on alternative means of achieving similar results but since we don't know what the intended purpose is nobody's going to be able to give you a best method.
I can't imagine anybody wanting to sit down and write your code for you, even if they did what are you going to learn and how are you going to deal with a problem when it comes to the next stage?
You're beeing an unpolite prick since the begining. If you're not happy then go elsewhere.
Shall we wait for the cats?
This is a forum, where people share freely so everyone can progress.
You asked for something. You didn't give us enough informations to help you, though we asked 3 times. I told you why your script doesn't work. Yet there are propably better way to achieve what you want because your script took like 3 min to complete on a poor sphere.
You keep patronizing.
Hence you're a troll, and you waste our time.
You must be trolling.