News:

Please note new Forum URL: forum.designcad.com

Main Menu
DesignCAD 3D Max 2027 box
Now available

DesignCAD 2027

Hatches that follow their boundaries, an on-screen dial to turn your model, and a way to find any command by name, in a clean Windows 11 look.

curve intersects

Started by Dr PR, April 22, 2008, 12:47:04 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Dr PR

The "Intersect 2" function to find the intersection of two lines does not work predictably with circles and curves. Sometimes it produces and intersect point and sometimes it doesn't. When it does the intersect point may not be exactly on the curve. This can be very frustrating.

I have learned from experimenting that you can improve the reliability and accuracy of the operation, at least with intersects of straight lines and circles. If the "Intersect 2" function fails to find the intersect of a line with a circle, draw another circle with the same radius as the first, but in a plane perpendicular to the plane of the first circle. Then try to find an intersection of 1) the line and the new circle, 2) the new circle with the old circle, or 3) the old circle with the new circle. Chances are pretty good one of these additional "Intersect 2" operations will work.

Note: when you draw the circles you must be sure they actually intersect the line. To be sure, set the center on the end of the line, the radius point at the desired distance on a radius that is more or less perpendicular from the line, and the third direction point on the other end of the line. This ensures that the circle does intersect the line.
DesignCAD user since 1987

support

Zooming in close helps but there was in the past and still is today a bit of difference between the mathmatic path of the curve or circle and the displayed path of the curve or circle. This happens because pixels on the screen display or just not as accurate as the math in DCAD is.
I know that sounds confusing but it is true.

Rob S

#2
Jerry

If what you say is true, then one would think the "displayed" intersection should never be off by more than one pixel.

It seems to me that DCAD uses different math to calculate the display path of the curve than what it uses to calculate the intersection with another line.

There is another topic on here about converting curves to segmented lines, and you can really see much larger discrepancies in location in some of those examples.

http://forum.designcad.com/index.php?topic=1288.0
User since forever

Lar

I always assumed it was the way Jerry describes it.

Lar

bdeck

Hello all,

I'll have to agree with Rob and DrPR on this one.

The attached demo file provides a persuasive argument that the error is not merely a rendering error.

BD

prl

The parallel (=) command gravity snapping back to the first point set (itself - a zero offset) is what I used in the other topic to verify that DesignCAD is using different math routines.

Take Bd's curve in the drawing he provided.

Case 1.  Invoke the parallel = command, gravity snap to a curve control point to select the curve and then gravity snap back to the same control point to set the offset (a zero offset). Select all, in point select mode, zoom in tight to the curve and examine.

Now start clean again,

Case 2.  Invoke the parallel = command, line snap to the curve say midway between two control points and gravity snap back to the line snap point you just used to select the line. Select all, in point select mode, zoom in tight to the curve and examine.

It's not a rendering issue. DesignCAD can not find a point on a curve between control points.

Edit: I attached an AVI file that demos this. Too bad that these AVI are so large.  This could be a decent way of showing bugs.

prl

Okay, sorry I've strayed off-topic somewhat.  I was annoyed at the large AVI file sizes in the post above and I came across this screen2exe freeware.  Seems to create a very tight file screen executable, good enough for showing what I want.  Thought maybe somebody else would be interested.

bdeck

#7
Hi prl,

I modified my demo to show that the line snap error you illustrated uses yet another algorithm that differs from the one generating the trim error.

Also, in the final example, note that a trimmed curve locates all the node points correctly, except that the trim point itself is misplaced.

See Attached.




Regards,

BD

prl

Bd, I took your observation about the different algorithms and made another one of these screen recordings. I first trimmed a line to the curve using Trim 1.  Then using basiccad I turned off the layer with this line so I can still see it but it is invisible to the snapping modes. I then started a second line and using the line snap hovered in the same area. You're correct, two different algorithms otherwise it should pass through the end of the incorrectly trimmed blue line.

bdeck

Or perhaps the same algorithm with different granularity.

Both seem to use a coarse linear interpolation that doesnt approach the floating point precision possible with these boxes.

Blue line here is line trim, red line is k command.

BD

bdeck

#10
And dont forget the Surface Connect error.  (see attached)

When executing the SurfaceConnect command between curves, DC first creates a zero distance parallel curve from each defining curve.

Then, DC converts that new curve (with 12 times more nodes) to a polyline using the curve-to-line function.

It then interpolates equidistant points along that new polyline to create vertices for the new surface.

NONE of intermediate vertices of the new surface will coincide with ANY of the defining curves, because the vertices of the surface are equidistant, while the vertices of the polyline are not.*

(Circles and arcs are similarly displaced from surfaces nominally connecting them. Circles and arcs are first converted to sloppy 40-gons. Then the surface, regardless of facet density, is interpolated from the 40-gon.  Lord knows why.)

BD


* Oddly, if the same polyline were used as input to the Surface Connect command, the surface vertices would not be equidistant, and the vertex lines would not be parallel, but they would intersect the curve. This is probably not a good way to improve precision, because the surface between the stations could behave unpredictably.