cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 
Starting August 6, 2024, TLS 1.2 will be the minimum required protocol version for Graphisoft products and services that require an online connection. Learn more…
Libraries & objects
About Archicad and BIMcloud libraries, their management and migration, objects and other library parts, etc.

offsetting a hole in a PRISM, suggestions?

Anonymous
Not applicable
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.
11 REPLIES 11
LiHigh
Newcomer
Getting the offset coords is no problem. But, determine the direction of offset requires complex math. I'll see if I've the spare time....
Howard Phua

Win 10, Archicad 19 INT
Anonymous
Not applicable
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