Announcements

Announcement: We’re aware of an issue affecting starting a new topic from category pages and creating new blog posts. New topics can still be started directly from the relevant board. Learn more here.

How to use ellipticalArc method of AcGiGeometry

How to use ellipticalArc method of AcGiGeometry

Anonymous
Not applicable
1,123 Views
2 Replies
Message 1 of 3

How to use ellipticalArc method of AcGiGeometry

Anonymous
Not applicable

In custom entity I need to draw slice of cylinder as elliptical arc in subViewportDraw(). I calculated center/start/end points, major/minor radius, normal and tilt angle. I have trouble for calculating the start and end angle from start and end points. I used upvector of viewport for angle calculation. but seems it need diffrent calculation. Can somebody help in this regards?

 

Thanks

 

0 Likes
Accepted solutions (1)
1,124 Views
2 Replies
Replies (2)
Message 2 of 3

tbrammer
Advisor
Advisor
Accepted solution

I have attached a small DWG. The red curve is an ellipse.

Start- and End-Angle are measured from the major axis vector inside of the ellipse plane.

So if you rotate the ellipse only the major/minor axis will change - Start- and End-Angle will stay the same.

I think ellipticalArc() uses the same geometric logic. AutoCAD displays angeles in degrees (0-360°). The ARX API uses radians (0-2*pi).

Hope that helps.

 

Cheers

--Thomas


Thomas Brammer ● Software Developer ● imos AGLinkedIn
If an answer solves your problem please [ACCEPT SOLUTION]. Otherwise explain why not.

Message 3 of 3

Anonymous
Not applicable

You are correct. I was in assumption that angle should relate to WCS.

elliptical arc.PNG

Here are two viewports shows my custom entity. other viewport Is just rotated from first. I added calculation to add rotation of view using viewport up vector. But it seems its not required. The blue curve is with added rotation and green curve is fix 0 to 1.5PI.

 

I will try with fix angle.

0 Likes