Florim Posted July 19, 2022 Posted July 19, 2022 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 Quote
mhupp Posted July 19, 2022 Posted July 19, 2022 (edited) 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 Edited July 19, 2022 by mhupp Quote
fuccaro Posted August 30, 2022 Posted August 30, 2022 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 Quote
fuccaro Posted August 30, 2022 Posted August 30, 2022 Me again with some more details. here is the array, "big enough" for the outline. 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 Here is my outline, converted to region too That's what I get after using the INTERSECT command, followed by EXPLODE This is what quickselect returned and finaly the final result. Maybe I should have saved a copy of the outline before I converted it to region... 1 Quote
BIGAL Posted August 30, 2022 Posted August 30, 2022 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 ! Quote
Recommended Posts
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.