ScriptSpot

Forum topic · General Scripting

slice tool

By titane357 · 2010-12-28

Description

hello
I wrote a little script to slice (with a number of slice) selected faces according a two points direction (by two clics)
It works well on objects without rotation.
Anybody can help to make it works in any case ?

(
local savesnap=snapMode.active
snapMode.active=true

pta = pickpoint snap:#3d
ptb = pickpoint snap:#3d rubberBand:pta
ptd = ( ptb - pta )
nptd = normalize ptd
posO = $.pos

print posO

na = nptd[1]
nb = nptd[2]
nc = nptd[3]
try destroyDialog rlslice catch()
global rlslice = rollout rlslice "Slice"
(
button butconnect "GO" pos:[2,2]
spinner spX "X " width:60 range:[2,100,3] type:#integer pos:[55,5]
on butconnect pressed do
(
for i=1 to (spX.value-1) do
(
inc = (ptd/(spX.value))
ppp = (inc * i) + pta
--Point pos: ppp

pppL = ppp - posO
$.EditablePoly.slice [na,nb,nc] pppL flaggedFacesOnly:on
)
)
)
createDialog rlslice 160 50

snapMode.active=savesnap
)

Comments (2)

it works

Anubis · 2011-01-03

Hi Titane,
I test it (Max2009) and it works well even with rotated objects

titane357 · 2011-01-04

hello anubis,
yes it slice selected faces but not like I want.... :-(

Attachments