Archived

This topic is now archived and is closed to further replies.

rounding on polygonsoup

This topic is 5146 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Does anyone know of any papers, resources or whatever on the subject of rounding sharp edges? I need to apply the operation to a polygon model. I can find very little info on the topic. And the info that is available only talks about models with extra cad-information. Every thought or idea is welcome. Thanks.

Share this post


Link to post
Share on other sites
hmm, thats no easy task... what kind of polygons are you talking about here? if you give a better idea of what ur trying to do maybe someone will be able to help you... is it for 2D or 3D?

[edited by - SpaceDude on November 10, 2003 1:40:04 PM]

Share this post


Link to post
Share on other sites
It''s 3D. The model could come from scanned in data. An interesting example is the intersection curve between two cylinders with almost perpendicular axes. This curve will be sharp. If you would round this "edge" it would look like the two cylinders are welded together.
And it''s a difficult task indeed ;-)

Share this post


Link to post
Share on other sites
Theoretically...

1. Find a sharp edge between two adjacent polygons by comparing the face normals.

2. Split the edge by duplicating the vertices (separate vertices for each face) so each poly has its own edge rather than sharing one.

3. Move the edges away from each other, along the face tangents. How far to move depends on how round you want it.

4. Stitch the gap by creating a new quad between the two polys, and a triangle in each end of the gap (to reconnect neighboring polys that have become partially separated).

Of course, actually implementing it will no doubt prove much more interesting

Share this post


Link to post
Share on other sites
The problem with doing it polygon by polygon is that it won''t work when you want to make the size of the curve large relative to the size of the polygons (for ex: if you have highly tesselated shapes).
What I would do would be to "Find a sharp edge between two adjacent polygons by comparing the face normals" as in step 1 above. Then, identify all polygons that lie on ''almost the same plane'' as either one (again using normals, plus an arbitrary threshold value). Next, calculate a sphere with the desired radius (how round you want the curve) located such that the surface of the sphere touches all vertexes of the ''sharp edge'' and the center of the sphere is on a line whose slope is the average of the normals of the two polygons that lie on the ''sharp edge''. Then, for all polygons that are marked as on ''almost the same plane'' as the two original polygon, select each point of the polygon and if it inside the sphere, move it towards the survace of the sphere depending on a weighting value that decreases as distance to the originally selected edge increases.

I''m not good at explaining things and I''m no good at art either, so maybe somebody that understands could draw a nice picture? I''d clean up my wording but I have to go to class now. Maybe I''ll fix it up later =-)

Share this post


Link to post
Share on other sites
I don''t think there is a single "clean" solution that will work in all cases... whatever you do its gonna need a lot of tweaking to get it right...

You should look into bezier curves if you don''t know what they are, how you would apply it to a 3D surface i''m not sure

Share this post


Link to post
Share on other sites
The solution to this problem is to use "implicit surfaces." Metaballs are one example of an implicit surface technique that is common in computer graphics. The idea is that the underlying geometry generates a scalar field that fills space, and the smooth, welded geometry is an isosurface within that field that lies very close to the underlying geometry. Near the joint between two objects, the scalar field is affected by both/all underlying geometries and this blended field is the reason the weld will be smooth when you extract the isosurface.

This approach can produce very nice geometry. As others pointed out, its not trivial to code. It also looks best if you tessellate the isosurface into a great many triangles. Would require some experimentation/tweaking to get a good looking surface with few triangles.

The benefit of an approach such as this is that it can COMPLETELY AVOID handling of special cases. This is a very significant benefit, once you get a handle on how to code the isosurface extraction.

Some links:

http://astronomy.swin.edu.au/~pbourke/modelling/implicitsurf/
http://www.cs.unc.edu/~hoff/projects/compgeom/implicit.ppt

Graham Rhodes
Senior Scientist
Applied Research Associates, Inc.

Share this post


Link to post
Share on other sites
Ah yes, I wasn''t thinking of the case when you want to smooth something already highly tesselated (without changing the amount of tesselation). What I described was more or less what 3DSMax "mesh smooth" does, which is to tesselate the object further by rounding edges.

Share this post


Link to post
Share on other sites
Thanks for the replies!
My own solution so far would be something like Extrarius explained.
I also thought about approximating the geometry with easier geometry (replacing trianglesoup by actual planes, or large polygons) and use that for rounding 3dsmax-style. But that would probably be rather hard to do :-) The implicit surfaces approach seems to be something along those lines. I will certainly look into it.

Share this post


Link to post
Share on other sites