Jump to content

block multiplication in a contour


Recommended Posts

Hi, I need you to help me too. I have an irregular outline and I want to fill it with a block. the block is rectangular, I hope to find something to create the block to select the contour and the block. inside the contour to multiply the blocks. but where a block does not enter, do not place it. does anyone know an order like this? thanks

 I also attached pictures with an example of contour, block and how I want it to look at the end

FO6DLK.jpgFO67TF.jpgFO6sR6.jpg

Link to comment
Share on other sites

You are tying to cut out these blocks form a scrap material? Best bet is to look for a nesting program or lisp. usually not free and if they are they are not very good. i know vcarve a cnc software has a really nice nesting (but its expensive) Where you can set how far from the perimeter, spacing between blocks and what angles things can rotate.

 

Quick an dirty you could tile them to cover the whole polyline and use this lisp to select the ones that are crossing to delete. then fill in the gaps by rotating them.

;;----------------------------------------------------------------------;;
;;HIGLIGHT BLOCKS THAT CROSS POLYLINE
(defun C:PCross (/ SS SS1 SS2 coords)
  (if (setq SS (ssget "_+.:E:S" '((0 . "*POLYLINE"))))
    (progn
      (setq coords (vl-remove-if 'not (mapcar (function (lambda (p) (if (= 10 (car p)) (cdr p)))) (entget (ssname SS 0)))))
      (setq SS1 (ssget "_WP" coords '((0 . "INSERT"))))
      (setq SS2 (ssget "_CP" coords '((0 . "INSERT"))))
      (foreach blk (vl-remove-if 'listp (mapcar 'cadr (ssnamex SS1)))
        (ssdel blk SS2)
      )
      (sssetfirst nil SS2)
    ) 
  )
  (princ)
)

 

With a couple of mins was able to fit in 110 on the left 117 on the right with rotating the polyline

image.png.59d00e14ea36fe357f7e503e4a88af77.png

Edited by mhupp
Link to comment
Share on other sites

  • 1 month later...

Is it too late for a reply? Maybe this will help others...

So, draw the rectangle first and convert it to region. Let's note it's area with A. Make a rectangular array of regions. Have enough rectangles to cover your outline, you will delete the ones falling-out. Make the array not associative, or explode it after creation. Use the UNION command on those rectangular regions.

Next draw the outline. It must be a closed polyline. Convert it to region too.

Use the INTERSECT command. Intersect the last created region and the union created at the previous step. At this point you should have the internal rectangles (that's what you asked for) and the ones crossing the outline. Explode the region, so now you have trimmed regions and full sized ones. Use quickselct to find the ones having the area equal with A

Link to comment
Share on other sites

Me again with some more details.

c1.png.a5ad8e6187b8c445e33a716a01c3d827.png

here is the array, "big enough" for the outline.

c2.thumb.png.abf17910ba3cbd68ab5cbe098b147939.png

What I forgot to say: make the rectangles just a litle bit smaller as you need them, so in the array they doesen't touch each-other

c3.thumb.png.946a728da0c2b8914bf8d097d10ad2ca.png

Here is my outline, converted to region too

 

c4.thumb.png.cddd12f54cb3b501f81ca733989fe3f0.png

That's what I get after using the INTERSECT command, folloc5.thumb.png.7fa81a42a39502aa80cb133a42c8a799.pngwed by EXPLODE

This is what quickselect returned

c6.png.bc5444494668e8b9ed21cac0cd1746a0.png

and finaly the final result. Maybe I should have saved a copy of the outline before I converted it to region...

  • Like 1
Link to comment
Share on other sites

Hi fuccaro wrote the same like 30+ years ago to do concrete waffle slabs, no need for regions, yes used a over sized array, the other option was pick a corner as the control point and would do a X & Y offset. Then remove all out side of the polyline any shape etc like yours. 

 

It is the one  bit of code that I dont have as was done for the Autodesk dealer / company I worked for so they own it.

 

A side note called in on a company, me selling CAD services, they advised they had this great waffle program, my response was. "Yes I wrote it and the original company it was done for never paid for it". Staff member went very quite after that.

 

I think it used the method of using SSGET & CP & WP and would put objects on a dummy layer and turn off then erase all that was left, turn on dummy layer and change back to correct layer, all done !

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...