I having corner vectors so I can find maximum lengths. Using this, largest rectangle can be patterned.
Is there any option to check tile inside or outside polygon area to add or skip tile?
Add Code used:
Code: Select all
objs = FreeCAD.ActiveDocument.Objects
for obj in objs:
if obj.isDerivedFrom("Part::Extrusion") :
bb=obj.Shape.BoundBox
j = 0
for x in range(0,int(bb.XLength),500) :
i = 0
for x in range(0,int(bb.YLength),500) :
CP001=FreeCAD.ActiveDocument.addObject("Part::Box","CP")
CP001.Length = 500
CP001.Width = 500
CP001.Height = 10
CP001.Placement=App.Placement(App.Vector(0+j*500,0+i*500,0),App.Rotation(App.Vector(0,0,1),0))
i = i + 1
j = j + 1
App.activeDocument().recompute()