[Closed] Control edge script idea. (scripters please read) posted by MRAY
hi MRAY,
This is what i did for a test.
I didnt handle concave/convex objs. Correct the script if you wish.
It works well for CUBES!. Also i think it works well for convex FACES too.
I’d be glad to read your posts about the bugs or if you have a better Alg. and son on.:bounce:
you can use it in a utility or as a macro or… .
–I DO THIS TO LEARN MORE.
–I’m a new user of maxscript and its not the best way to do this task
–Help me and MRAY if you can.
–yet buggy
–can be optimized, i didnt have time to ommit some extra fns.
if classof $ == Editable_Poly then
(
i = 1
offset = -1.0
num_faces = polyOp.getNumfaces $
undo off
(
polyOp.setFaceSelection $ #{1..num_faces}
for i = 1 to num_faces do
(
face_center = polyOp.getFaceCenter $ i
face_normal = polyOp.getFaceNormal $ i
face_center = face_center + offset*(face_normal)
slice_plane_ray = ray face_center face_normal
--$.EditablePoly.GrowSelection ()
face_list = polyOp.setFaceSelection $
polyOp.slice $ face_list slice_plane_ray
num_new_faces = polyOp.getNumfaces $
polyOp.setFaceSelection $ #{1..num_new_faces}
print num_new_faces
)
)
update $
)
else messagebox “wrong class!”
–bye
I have some problems with copy pasting! I think it takes a long time for me to learn how to post threads!!!excuse me.
if classof $ == Editable_Poly then
(
i = 1
offset = -1.0
num_faces = polyOp.getNumfaces $
undo off
(
polyOp.setFaceSelection $ #{1..num_faces}
for i = 1 to num_faces do
(
face_center = polyOp.getFaceCenter $ i
face_normal = polyOp.getFaceNormal $ i
face_center = face_center + offset*(face_normal)
slice_plane_ray = ray face_center face_normal
--polyOp.setSlicePlane $ slice_plane_ray 50
--$.EditablePoly.GrowSelection ()
face_list = polyOp.getFaceSelection $
polyOp.slice $ face_list slice_plane_ray
num_new_faces = polyOp.getNumfaces $
polyOp.setFaceSelection $ #{1..num_new_faces}
print num_new_faces
)
)
update $
)
else messagebox “wrong class!”
Hey soshiant!!
I’m trying to check out your script but i have no idea on how to use it
So i copy the script and then what?
I’m not a scripter so i’m clueless about this stuff
but i wiil definently be your tester for this!
thanks and talk soon!
-Mray-
well i figured it out
i was checking it out and well its a great start!
Just wondering if you could make the control edges only on selected edges instead of doing it all at once?
Also if it would be possible to have some type of numerical real time input/ spinner like maxes default chamfer so you could have more control to set distences between the control edges from the original edge? – view image please ——-
Talk soon!
-Mray-
ok,
some notes about your last post MRAY:
1.this script is not an edge-based script, because slice_plane only works on selected faces.
2.if you see the slice plane in epoly, we have only one there in max not as many as FACES.
3.in edge sub-object level slice plane will cut all of the epoly not selected edges.
this algorithm is not capable of diong per-edge calculations(its obvious).
i dont know how to preveiw slice plane for so many faces in real time.MAX’s edge polyOps like splineOps are limited.
Best way i think, is to copy the edges into an array, then using a linear or cubic function
calculate the vertices and reconstruc the topology from the vertices.I think it’s plssible to
make this real time.
I mean if you want to fillet an edge you have to do sth like bevel modifier in max, to find where the fillet starts. I also read jul654321’s thread, this is sth diffrent than my script, but the idea i said about topology can be applied to this task. Just needs some search and sort funcs to find position of vertices and adjucent edges.
sorry for mistakes.
about the interface,i’ll post a version as soon as i get rid of my final exams.