Notifications
Clear all

[Closed] Select spline vertex inside of a volume or object?

Hi

Is there any script or trick to do similar things that *the Vol.Select does for mesh.

I mean for example select some vertices of a spline which is inside of an object or mesh or close spline.

Thanks in advance

3 Replies



(
delete objects
max create mode   

shp = star radius1:50 radius2:20 numpoints:42
addModifier shp (Normalize_Spline length:5)   
convertToSplineShape shp
select shp

geo = GeoSphere radius:33 pos:[10,10,0]
geo.boxmode = on

gc()
t1=timestamp()
hf = heapfree
   
msh = copy shp
msh.steps = 0
addModifier msh (volumeselect level:1 volume:3 node:geo)
selected = getVertSelection msh
delete msh

index = [0,0]
for i=1 to numsplines shp do (      
   for j=1 to numKnots shp i where (index[1] += 1; selected[index[1]] ) do (
      setKnotSelection shp i #(j) keep:true
   )
)

max modify mode
subobjectlevel = 1
format "Time: %sec. Mem: %
" ((timestamp()-t1)/1000 as float) (hf-heapfree)
)

that’s it

ps. some times it may produce wrong selections. it can be fixed either by reversing a spline or building that temporary mesh manually

Thank you very much for this beautiful trick.

I’m a beginner *maxscript user *and what is these 3 lines for?

these are for profiling execution time and memory consumption.
you may remove these lines along with format “Time…