Spline penetration through mesh

2 votes
Version: 
V2

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

Additional Info: 

Basic idea is to marking penetration point according to current spline preferences (steps, optimize, adaptive), exactly as you see it in viewport.

Instalation: drag & drop in max viewport ; customize/preferences--> category: dboxx_tool

Version Requirement: 
3ds max 2012 (probably works in older versions; not tested)
Video URL: 
AttachmentSize
penetration_v02.ms14.8 KB

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
dboxx's picture

...

thanx a lot barigazy, I'll keep in mind next time.

barigazy's picture

...

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.	
)

bga

barigazy's picture

...

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

;)

bga

dboxx's picture

...

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's picture

...

Cool idea but I think that progress bar slows down whole process a lot.

bga

visualizer's picture

wow

Hey
Something out of the way but cool thought.... not sure but some places it may be magical tool:)

igamaximus's picture

Big tool i would rather say

Amazing tool, thank you very much for your work Dboxx!

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.