I have a triangle shaped object created with a PRISM. I need to cut a triangle shaped hole inside it that is equidistant (or basically offset) on all 3 sides. The width of my trim(determined by user) determines the offset.
Any suggestions on how to get the coordinates for the interior triangle?
The angles of the interior triangle are all the same as the overall triangles object.
This may be more of a math question than an
ArchiCAD question unless someone can tell me some secret offset command for inside a PRISM.
Footing 1 11 - slab accessory 2d Script has a good example of offsetting a poly, its not commented enough but you will get the gist.
!-------------------------
! Start the polygon offset
!-------------------------
For i=crd_begend[1] To crd_begend[2] ! Precalculate the data
pen 2 ! Draw the polygon beFore the offset
If i<crd_begend[2] Then
data[3]=ac_coords[i+1][2]-ac_coords[2] ! Direction vector
data[4]=ac_coords[i+1][3]-ac_coords[3] ! Direction vector
Else
data[3]=ac_coords[crd_begend[1]+1][2]-ac_coords[2] ! Direction vector
data[4]=ac_coords[crd_begend[1]+1][3]-ac_coords[3] ! Direction vector
EndIf
If abs(data[3])<epszilon Then data[3]=0
If abs(data[4])<epszilon Then data[4]=0
length=sqr(data[3]^2+data[4]^2) ! Make the unit vector
vect_x=offset*dir_x*data[4]/length
vect_y=offset*dir_y*data[3]/length
data[1]=ac_coords[2]+vect_x
data[2]=ac_coords[3]+vect_y
next i