Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- try (destroydialog X ) catch ()
- rollout X "" (
- button holegen "hole gen"
- fn hoole =
- (
- gc();t1=timestamp();hf = heapfree
- with redraw off
- with undo off (
- gc()
- delete objects
- Rectangle width:100 length:100 isSelected:true
- R = (distance $.max $.min) / 20.0
- circles = #()
- todelete = #()
- format "0 Time: %sec. Mem: %\n" ((timestamp()-t1)/1000 as float) (hf-heapfree)
- for i=1 to 3333 do
- (
- pt = random ($.min + [R,R,0]) ($.max - [R,R,0])
- rR = random (R*0.1) R
- intersecting = false
- for n in circles while not intersecting where distance pt n.pos < (n.radius + rR) do
- (
- intersecting = true
- )
- if not intersecting then
- (
- append circles (Circle pos:pt radius:rR)
- )
- )
- format "1 Time: %sec. Mem: %\n" ((timestamp()-t1)/1000 as float) (hf-heapfree)
- rect = copy $
- convertToSplineShape rect
- for c in circles do addAndWeld rect (convertToSplineShape c) -1
- updateshape rect
- format "2 Time: %sec. Mem: %\n" ((timestamp()-t1)/1000 as float) (hf-heapfree)
- select rect
- -- addModifier $ (Edit_Poly())
- )
- format "Time: %sec. Mem: %\n" ((timestamp()-t1)/1000 as float) (hf-heapfree)
- )
- on holegen pressed do hoole()
- )
- createDialog X pos:[100,100]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement