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.

Proportional surface connect

Started by Dr PR, September 12, 2007, 01:10:31 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Dr PR

One problem with the Draw/Surface Connect function is that is spaces the planes evenly along the curve (if you don't force it to use the original points). This works OK as long as the surface doesn't curve too much. But when the surface has both gentle and sharp curves the sharp edges can be too "chunky" - they render as faceted surfaces instead of smooth surfaces.

You can increase the number of planes per line and the number of intermediate breaks, but DesignCAD places severe restrictions upon the total number of planes in the surface. As the number of connected lines increases you must reduce the number of intermediate breaks and planes per line. You get a lot of planes and breaks in large smooth curves where you don't need them, and not enough in sharp curves where they are needed. Here is a suggestion for resolving these problems.

Instead of spacing the planes evenly along the curves, place them proportional to the amount of curvature in the line.

The geometrical solution would be to calculate the tangent to the line at points along the line. Where the angle between tangents exceeds a preset angle (user defined) place a point on the line. Draw the planes using these points. Where the curve is gentle the points will be widely spaced. At sharp curves the points will be closely spaced. The resulting planes will be drawn where they are needed, and the total number of planes will be the minimum necessary to produce the desired surface. Larger preset angles will produce rougher surfaces with fewer planes. Small angles will produce smoother surfaces with more planes.

The same technique could be used to calculate intermediate breaks between lines, but I think that will be much more complicated. The resulting surfaces would be really nice, though.

Also, please increase the number of planes per line and intermediate breaks. The current limits aren't enough for some jobs.
DesignCAD user since 1987

bdeck

Hi Doc,

That would be great. I like the idea of putting the smarts for continuous variation in the software.

But I would settle for user defined tangent lines (lines where sufaces of different curvature meet), because they would require less developer tweaking to get right the first time, and htey may offer some added versatility.

( See my prior post )  http://forum.designcad.com/index.php?topic=652.0

Also, how to handle convergence of tangencies could take some thought.

BD

Dr PR

I agree. How do you deal with intersecting tangents on lines that curve in 3 dimensions? It hurts my brain to think about it. However, if you know the curvature at a point on the line (and the program must in order to draw the line) it is easy to produce a tangental plane, so you could use the line at the intersection of tangential planes. That line will intersect with another plane drawn between the tangent points. Draw lines from that intersection to the tangent points and calculate the angle between the lines. Nothing to it!

One problem will be the number of iterations at points along the line that will be necessary to locate appropriate pairs of tangent points. It might be a pretty slow operation.

Another problem will be dealing with different numbers of points on the lines. The number of points on a line will be dependent upon curvature, so if the lines differ greatly the number of calculated points will vary. How do you connect them to create a grid?

Doesn't sound undoable. It's just a software problem!
DesignCAD user since 1987

Dr PR

I have given this some more thought. For the proportional surface connect operation the program should ask for two values from the user:

1. Smoothness. This is essentially the same as maximum angle between tangents (see earlier post). It determines the distance between points on the curves for producing the planes in the grid.
2. Minimum radius. This has two effects. First, it allows the user to cause sharp bumps in the curves to be ignored. Actually the most important use of this value is to determine the starting parameters for calculating tangents. The minimum radius is the minimum distance along the line between tangent points.

Definitions:
Original curves. The curves the user produces to be used to generate the surface. "Curve" means original curve unless otherwise noted.
Intermediate curves. Lines (breaks) generated by the algorithm between the original curves.
Original points. Points the user set to define the original curves.
Tangent points. Temporary points on the original curves generated by the algorithm to test the amount of curvature of the original curve.
Surface points. Points the algorithm generates along the original curves to be used to generate the surface.
Selection point. The points on or near the curves the user placed to select the curves to be used for surface generation.

Procedure:
The user sets selection points on all the curves to be used for the surface. The program selects a bounding curve (at the edge of the surface) to start.

To set surface points:
1. Find the starting point. Start at an end point of the curve. If it is a closed loop, start at the original point nearest the selection point set by the user. This is the first surface point (point for generating the surface) on the curve.
2. Find a tangent point. Proceed along the curve a distance equal to the minimum radius and generate a plane tangent to the curve at that tangent point.
3. Find the next tangent point. Proceed further along the curve in the same direction for a distance equal to the minimum radius. Generate a tangent plane at this tangent point.
4. Tangent plane intersection line. Calculate the intersection of the two tangent planes - this will be a line segment.
5. Calculate the angle between tangent planes. Draw a line between the last two tangent points. Find the midpoint of this line and draw a perpendicular from this midpoint to the tangent plane intersection line. Calculate the angle between the two tangent points and the intersect point on the tangent plane intersection line.
6. IF the angle is GREATER than the minimum tangent angle, discard the last tangent point and tangent plane and GO TO 3 to continue down the line.
ELSE this angle is LESS than or EQUAL to the minimum tangent angle (smoothness) so continue at 7.
7. Calculate a new point on the curve. Generate a plane with axes parallel to the tangent plane intersect line and the perpendicular to the tangent intersect line and the midpoint of the line connencting the two tangent points. Find the intersect point of the original curve and this plane. Set a new surface point on the curve. Discard the oldest tangent point and tangent plane.
8. IF the curve is not a closed loop and IF this point lies on the curve
OR IF the curve is a closed loop and IF this point does not lie beyond the initial starting point
GO TO 3 to continue generating surface points.
ELSE
IF this plane lies beyond the end of the curve,
AND the curve is not a closed loop, set a surface point at the end of the curve. Discard all tangent points and tangent planes.
9. Start over at 1 with the next curve until all curves have been processed.

This procedure will generate surface points along each original curve spaced proportionally to the curvature. It is unlikely that all curves will have the same number of surface points. To connect the surface between curves the drawing algorithm will either have to generate a surface with triangles between curves with unequal numbers of surface points or go back and fill in points on each curve so all curves have the same number of surface points.

Determining the proportional number of intermediate curves (breaks) between original curves would work the same way except the algorithm would use corresponding surface points on sets of three adjacent original curves to calculate the tangent intersect angle and consequently the number of intermediate curves that must be generated between the original curves.

After all surface points have been calculated, draw the surface.

This is the starting idea. I'm sure there are details I have missed.
DesignCAD user since 1987

support

Better grid and surface control is something we have wanted in DesignCAd for a few versions now we just have not found a method that accomplishes what we need it to do while working within the environs of the DesignCAD program engine. We will continue to do research and development in this area though so please keep your hopes up and keep posting ideas.