Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Simplify Circle2D with lines 3

Status
Not open for further replies.

iscariot

Mechanical
Oct 15, 2009
154
DE
Any idea how I could take one Circle2D and simplify it with lines?
I would need something like below.
SimplifyCircle_fxxmqb.png
 
Replies continue below

Recommended for you

Hi iscariot,
I think maybe even easier is to simplify it with a spline. Take points from an arc and connect them with a spline curve. To create a spline you just provide spline poles as parameters to a CreateSpline. This way you do it in one shot ...

Tesak
- Text along a curve for Catia V5
 
Create equidistant points on the circle, then join them with lines...

Eric N.
indocti discant et ament meminisse periti
 
As input I have only arcs of circle, not full circles. I need only to simplify with lines this arcs of circle.
I am able to get from Circle 2D the radius, center point, start and end point but no more.

The question is how to create the necessary points only on the arc of circle and not on empty side?
Maybe I could create some equidistant points for complete circle (as told by itsmyjob) and next to check somehow which point intersects the Circle2D (arc of circle in my case).
 
Circle2D is just a curve, and all basic types (line, circle, spline, ellipse, line) seem to inherit methods from Curve2D. You can use Curve2D methods like GetParamExtents to get extents of a curve and then get points by GetPointAtParam method. Then it is up to you how you join them together.

Tesak
- Text along a curve for Catia V5
 
Tesak, this was the first thing to try for me but unfortunately for Circle2D it creates the points on almost complete the circle, not only for my arc. It ignore somehow that my curve is only arc and somehow it takes the curve as full circle.
 
I am afraid you do not use parametric extents properly. If your extents are p(0) and p(1) and your iParam for function GetPointAtParam(double iParam, CATSafeArrayVariant oPoint) is between p(0) and p(1), then you get points only on a visible part of a circle. If your arc is divided in x = 10 parts, then you get other points with a loop like this:

Code:
For i = 1 To x
    iParam = p(0) + (p(1) - p(0)) / x * i
        
    myCurve.GetPointAtParam iParam, currPoint        
    fact2D.CreatePoint currPoint(0), currPoint(1)
Next

What you get is shown below:

eng-tips-circle_frjm1c.png
.

p(0) and p(1) are parametric equivalents of the end-points of a curve, points in between extents lie on a curve.


Tesak
- Text along a curve for Catia V5
 
Thank you Tesak, you are fully right, now it is working.
 
Hi iscariot.

A parameter of an arc indicates the angle of the arc by the experience I tried.
(For the unit, the radian)

When acquiring many coordinates, the person who calculated from the angle,
a central coordinate and the radius is quick.


I have here for the sample from which 2D curved line is changed to a polyline within a tolerance.
Link
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top