Learn to manage BIM workflows and create professional Archicad templates with the BIM Manager Program.

Libraries & objects
About Archicad and BIMcloud libraries, their management and migration, objects and other library parts, etc.

Segmental Arc Trigonometry

Anonymous
Not applicable
Hello,
I am trying to define the trigonometry for a segmental arc
to be used ultimately in a MASS command object.
Therefor, I have to define the arc as straight segments
rather than using additional status codes.
The FOR loop that puts values into the buffer works only
for an arc with a subtended angle of 180° or a half circle.
Any other subtended angle makes a figure that has an arc
as part of it but it is distorted and the only thing
I can do is fill in arbitrary values in the line,
for i=1 to nf+1-1 step 1.
As an example, if A is set to 3'-11"
and the resolution is set to 72
and the sagetta is set to 1'-0",
then I have to change the line to read
for i=8 to nf+8-1 step 1.
I have to do this to get the arc to start at the point
a/2,b and end up at -a/2,b .

The problem is I do not know how to write a formula
that computes these values for any arc of any included angle
up to 180° for any value of sagetta between eps and a/2.
I need this to put into the FOR expression.

The attachment shows the derivation of the basic variables
and the 2D script as I have it so far.

Any insights, suggestions, hints would be greatly appreciated.
Thank you,
Peter Devlin

Segmental Arc test.jpg
6 REPLIES 6
Anonymous
Not applicable
Well, I came up with something that appears to work.
The variable "num" calculates where to start and end the arc.
It is an unhappy cludge partly because it has to round off
the value calculated so that it can be used to increment.
Because of the inherent inaccuracy it fails in the extreme
case of a small value for the sagetta like 1 1/2".
I wish I knew how to do this right.
Please see attachment showing the revised code.
Thank you,
Peter Devlin
LiHigh
Newcomer
Peter, try to simplify the whole things.
RAD=(a^2)/(8*bul)+(bul/2)
dy=b-(RAD-bul)
alpha=asn(0.5*a/RAD)


PUT a/2,-dy
PUT -a/2,-dy

P=2*ALPHA/res
FOR Q=-ALPHA TO ALPHA+0.5*p STEP P
  PUT RAD*SIN (Q), RAD*COS (Q)
NEXT Q


ADD2 0,dy

POLY2 nsp/2,5,
       USE(nsp)

FOR i= 1 to nsp/2
	HOTSPOT2 GET(2)
NEXT i

DEL 1
Howard Phua

Win 10, Archicad 19 INT
Anonymous
Not applicable
Hello LiHigh,
Thank you very much for posting back.
I will certainly try your code and much more importantly
try to understand it.
It is a little late now, my time, so I will wait till tomorrow
to study it.
Thank you,
Peter Devlin
Anonymous
Not applicable
Hello LiHigh,
I studied your code and it became obvious that I had
made some conceptual mistakes as well as getting to complicated.
Your code was an education for me and I want to thank you for it.
I have written down all the derivations and
diagramed everything for future reference.

There is one thing I don't understand.
Your code reads, FOR Q=-ALPHA TO ALPHA+0.5*p STEP P
Why do you add 0.5*p to the final interval ?

Thank you,
Peter Devlin
LiHigh
Newcomer
Peter wrote:
There is one thing I don't understand.
Your code reads, FOR Q=-ALPHA TO ALPHA+0.5*p STEP P
Why do you add 0.5*p to the final interval ?
"Use of real type can result in precision problem" Sound familiar!

I use 0.5*p just to be sure. Infact FOR Q=-ALPHA TO ALPHA+0.000001 STEP P works too.
Howard Phua

Win 10, Archicad 19 INT
Anonymous
Not applicable
Thank you LiHigh,
I suspected something like that.
Give it a little extra to make sure AC gets to the finish line.
Thanks,
Peter Devlin