How to get point on ellipse?

How to get point on ellipse?

Anonymous
Not applicable
1,772 Views
9 Replies
Message 1 of 10

How to get point on ellipse?

Anonymous
Not applicable

Hi all!
I need to get point on the ellipse in the plan. I have start point and length of ellipse arc . How can i get coordinate of end point?

0 Likes
Accepted solutions (1)
1,773 Views
9 Replies
Replies (9)
Message 2 of 10

jeremytammik
Autodesk
Autodesk

You will probably need more data about the ellipse itself, e.g., its centre, focal points, minor and major axis length.

 

From that and the data you mention you can determine the point location coordinates using standard geometrical methods, cf.

 

https://en.wikipedia.org/wiki/Ellipse

 



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

0 Likes
Message 3 of 10

Anonymous
Not applicable
Accepted solution

I was able to solve using the function  curve.Evaluate

0 Likes
Message 4 of 10

jeremytammik
Autodesk
Autodesk

Perfect solution! Congratulations.



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

0 Likes
Message 5 of 10

Anonymous
Not applicable

Unfortunately it not work. Because parameter of  Evaluate is not lenght of ellipse arc. Help me please.

0 Likes
Message 6 of 10

jeremytammik
Autodesk
Autodesk

The best way forward in such a situation is for you to share a really minimal piece of code that shows what input data you have. That will help determine the best approach. There are many ways to approach this, and they depend heavily on what data you have and what you need.  Again, I repeat that almost certainly everything you need is provided in the Wikipedia article mentioned above and other mathematical suggestions on the Internet.

 



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

0 Likes
Message 7 of 10

Anonymous
Not applicable

I have  an ellipse curve and lenght. I add the length to ellipse.getEndParameter(0) and I use ellipse.evaluate for getting a new point.

Dim len As Double = 5
                    Dim ep As Double = el.GetEndParameter(0) + len
                    Dim p As XYZ = el.Evaluate(ep, False) 'wrong

                    Dim p As XYZ = el.Evaluate(len / el.Length, True) ' wrong too
0 Likes
Message 8 of 10

jeremytammik
Autodesk
Autodesk

You mention a couple of 'wrong' results.

 

Please describe in words or by some other means exactly what you would consider 'right'.

 



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

0 Likes
Message 9 of 10

Anonymous
Not applicable

I want to get a point on the arc of an ellipse at which the distance along the arc from the beginning of the ellipse will be equal to the value of the variable "len".

 

Judging by this quote, you just need to add the length to the starting point of the ellipse:

 

"A ‘raw’ parameter. The start and end value of the parameter can be any value. For a given curve, the value of the minimum and maximum raw parameter can be obtained through Curve.GetEndParameter(int) . Raw parameters are useful because their units are the same as the Revit default units (feet). So to obtain a location 5 feet along the curve from the start point, you can take the raw parameter at the start and add 5 to it. "

https://knowledge.autodesk.com/ru/search-result/caas/CloudHelp/cloudhelp/2016/RUS/Revit-API/files/GU...

 

But it does not work.

0 Likes
Message 10 of 10

jeremytammik
Autodesk
Autodesk

I suggest you check the value of the raw parameter at various points along the ellipse and ponder its possible meaning.

  

I can well imagine that either the normalised or the raw parameter for an elliptical arc is in fact related to the arc angle, i.e., related to multiples of π.

  

Have you  installed RevitLookup?

  

If not, please do so now, before reading on.

  

Please use RevitLookup or other Revit database exploration tools to analyse the normalised and raw parameter values at different points along the ellipse:

  

https://thebuildingcoder.typepad.com/blog/2013/11/intimate-revit-database-exploration-with-the-pytho...

  

It may very well be much easier than you think.

 

Later: I did some research for you and found this old article on curves:

 

https://thebuildingcoder.typepad.com/blog/2010/01/curves.html

  

It does indeed state:

  

  • Elliptical arc: A bound elliptical segment.
  • Ellipse: An unbound ellipse. Identify with Curve.IsBound. Use raw parameter for evaluation (from 0 to 2π).

  

Cheers,

  

Jeremy

  



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

0 Likes