Little tool for marking penetration point of spline through mesh.
--Undo/redo works without crash
--Progress bar with cancel
--for high poly mesh you can specify polygons for faster progress
--works on transformed objects
--works without changing original objects and modifiers
Script
Spline penetration through mesh
By dboxx · 2013-08-27
- Version
- V2
- Version requirement
- 3ds max 2012 (probably works in older versions; not tested)
- Votes
- 2
- Download
- Download
Description
Additional Info
Videos
Attachments
- penetration_v02.ms — penetration_v02.ms15 KB
Comments (7)
dboxx · 2013-08-31
thanx a lot barigazy, I'll keep in mind next time.
dboxx · 2013-08-31
Believe me, bigger problem are complex calculation in iterations. Number of iterations is equal to product of mesh polygons count and line segments (real segments, which number depends of number of knots and spline steps). In case of high-poly mesh and high steps of spline, number of iterations could be extremely high and so calculation time (much more then few minutes). Without progress bar user could be thought that MAX is blocked and kill it from task manager.
As I've explained in video, there is a mode where script calculates only at selected polygons, when time of calculation is much faster (in blink of the eye :) )
barigazy · 2013-08-31
You can look also this solution. I not know is this type of Progress Bar works in max versions below 2012 but you can enable it ei.turn on/off after the calculation.(not require any formula to indicate some process)
try(destroyDialog ::bgaRoll)catch()
rollout bgaRoll "• • •"
(
local progBar
fn defColor r g b = ((dotNetClass "System.Drawing.Color").FromArgb r g b)
fn defRect x y w h = (dotNetObject "System.Drawing.Rectangle" x y w h)
local BG1 = defColor 28 28 28, BG2 = defColor 60 60 60
dotnetcontrol lbl "Label" pos:[5,5]
button btn_on "ON" pos:[5,20] width:70 height:18
button btn_off "OFF" pos:[85,20] width:70 height:18
on bgaRoll open do
(
lbl.backcolor = BG1 ; lbl.Size = dotNetObject "System.Drawing.Size" 150 10
progBar = dotNetObject "DevExpress.XtraEditors.MarqueeProgressBarControl"
--if you want to see small border uncomment next line and remove "Dock" line
progBar.Bounds = defRect 2 2 146 6
--if you not want to see small border uncomment next line and remove above "Bounds" line
--progBar.Dock = progBar.Dock.fill
progBar.backcolor = BG2
progBar.BorderStyle = progBar.BorderStyle.NoBorder
progBar.Enabled = off
lbl.controls.add(progBar)
)
on btn_on pressed do progBar.Enabled = on
on btn_off pressed do progBar.Enabled = off
)
createDialog bgaRoll 160 40 style:#(#style_titlebar, #style_sysmenu, #style_toolwindow)
I forgot to add +1
;)
barigazy · 2013-08-31
One more suggestion for speed up
Never use "polyop" or any other max struct inside for - loop. That can slows down process a lot.
Define local variable for any polyop operation and then use it in loop ei. :
-- example
local getFacesCount = polyop.getNumFaces
local getNormals = polyop.getFaceNormal
for i= 1 to getFacesCount obj_plane do
(
normal=getNormals obj_plane i
-------------------- etc.
)
barigazy · 2013-08-31
Cool idea but I think that progress bar slows down whole process a lot.
wow
visualizer · 2013-08-29
Hey
Something out of the way but cool thought.... not sure but some places it may be magical tool:)
Big tool i would rather say
igamaximus · 2013-08-29
Amazing tool, thank you very much for your work Dboxx!