Subject: CGAL users discussion list
List archive
- From: Sebastien Loriot <>
- To:
- Subject: Re: [cgal-discuss] Triangulate between pairs of distance curves
- Date: Thu, 21 Jan 2021 13:20:30 +0100
- Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None ; spf=Pass ; spf=None
- Ironport-phdr: 9a23:b/4H1xxwZVk/BkzXCy+O+j09IxM/srCxBDY+r6Qd0usXLvad9pjvdHbS+e9qxAeQG9mCurQd16GK6+igATVGvc/e9ihaMdRlbFwssY0uhQsuAcqIWwXQDcXBSGgEJvlET0Jv5HqhMEJYS47UblzWpWCuv3ZJQk2sfQV6Kf7oFYHMks+5y/69+4HJYwVPmTGxfa5+IA+5oAnMssQam5ZuJ6k+xhbGvndDZuBayX91KV6JkBvw+8W98IR//yhMvv4q6tJNX7j9c6kkV7JTES4oM3oy5M3ltBnDSRWA634BWWgIkRRGHhbI4gjiUpj+riX1uOx92DKHPcLtVrA7RS6i76ZwRxD2jioMKiM0/3vWisx0i6JbvQ6hqhliyIPafI2ZKPxzdb7bcNgHR2ROQ9xRWjRcDI2iYYsBD+kPM+hWoIbypVQBsRSwCBKwBO7t0DJEmmP60KM43uknDArI3BYgH9ULsHnMsdv6KrwdXvquzKnUzDXMcfVW0ir75ojPaBAhoPaMXa5tesfW0kkvEwTFjk+RqYziIzOZzOENs2yA4upvUOKgkW8nqwVrrjezwccsj5DEi4QIwV/L6St32pw6JcGkSEFle96kFoNduz+EO4Z0Rs4vR2VltDo5x7MJuZO2fjQHxYk7yhPba/KJc4uF7x3gWeifLzp0mG9pda6jixu280WuxOPxWtW63VtMsyFLnN7MtnUX2BzS7MiKUudy/ki71jaLzQzT7ftEIU8smarUKp4h3r4wlocIvkjZAiD2n0D2gLeXdkUi4Oio6v7obq/opp+GMYJ/lwLwMrw2l8ChHeg1NhICUmub9OimybHv4070TK9Fg/AyiqXVrorVKdgGqqO8HQBZzpws5hOhAzu6zdgVmHcKI0hbdB6bioXkP1PDL+z2Dfq6nlugjSlky+3DM7DjDZjALWPMnbLicLZz5UNT1gw+xs1F6Z1OELEOOvfzV1fxtNPGCh85NBS5w+P9B9V80oMSQGyOAqqEPK/Lv1+F6eYiL/ODZI8Svzb9JPwl6OD0gXAlnl8deLGl3ZoRaH+mAvRrO1uVbWboj9sbEmoHvhAyQPH0hFCBSzJeaHK/U7o55j4hCYKmCYnDRpqqgLyExCq7BZlWZmdcClCNFnfoa5+IW/IIaC+JLc9hlyYLVbmlS4M7yR6uswr6x6J9LuXI4i0YqY7j1N9t6uLPmhE97zh0A92A3GGMVGF7gn4IRyQt3K1kukx8ylKD0bBijPBCFNxT4elJUgYgOpLGwex6EYO6ZwTaY93cSEq6Ws70RnYqX9cpypkPZVx8EpOslFfYzi+yCvgUkbKMQ5c7+6aZ03nqLNtm0CX70rI8hWUrUtcaNXG6nrUtsE/IFovRmgOYkbyrfOISxmnW5WKbxC2Puk9fFwV/WKGAUXEEbVbNtofF4RbJQLaqTLgmKQBc0tWqK61Qa9Svg08Vau3kPYHlbmi4gHuxCBDA4rSWbY32MzEG2CLHCU8Y1QUX1XmDPAk6QCympjSNX3RVCVvzbha0oqFFo3ShQxpsll3YXwhaz7OwvyUtq7mEUfpKh+ALvS4gr3N/G1Pvh4uLWerFnBJoeeBnWf144FpD0jiE5Ql0P5jlMKU7w1BCIkJ4uETh0xgxAYJFw5Bz/SEaiTFqIKfd62tvMjaR3JT+ILrSczCg8xWmaqqQ0Vbbgo+b
As you said you can first compute the skeleton and keep it. Then you can
use the function CGAL::create_offset_polygons_2() to generate your inset
polygons for each elevation slice.
For the triangulation part, I would use an algorithm for reconstruction
from parallel slices (we something doing that that we should consider
finishing and releasing).
You can also handle it by hand by taking care of topological changes.
I hope I got your questions right.
Best,
Sebastien.
https://doc.cgal.org/latest/Straight_skeleton_2/group__PkgStraightSkeleton2OffsetFunctions.html#gae813d2f3d3be69c76abc4a54d7d01d2c
On 1/13/21 8:53 PM, Dov Grobgeld ( via cgal-discuss Mailing List) wrote:
Hello,
I have recently started a project that turns 2D text into a 3D mesh making heavy use of CGAL by the following algorithm:
1. Turn text into polygons with holes via pangocairo
2. Create straight skeletons of the polygon with holes
3. Create a set of distance curves from the skeletons
4. Triangulate the area between the distance curves.
5. Push the distance curves up in z by some formula. Currently I'm using a quarter circle starting at the outer boundary.
The project may be found at https://github.com/dov/pomelo <https://github.com/dov/pomelo> .
My question is how to efficiently do 3 and 4. I wanted to use the inward offset API but it seemed to me very inefficient that the distance curves returned do not retain any correspondence with the original boundary curve. Therefore when triangulating, you will need to create a set of polygons for the distance curve at d1 with holes, distance curve at d2, where d2>d1, and then triangulate that. My guess is that that is very inefficient.
What I did instead was to loop over "skeleton regions", which I defined as a polygon, with one line segment on the outer boundary, and the rest of the polygon line segments belonging to the skeleton, and then looped over all regions, and all distances and cut slices of the regions between each subsequent distance pair d1 and d2. I then triangulated these slices, and used CPD to deal with concave polygons.
I was a bit disappointed that I never used the inward offset API, and I am still wondering whether my apprehension was unjustified? Or is there perhaps a better way?
Thanks in advance and thanks a lot for CGAL!
Dov
--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://sympa.inria.fr/sympa/info/cgal-discuss
- [cgal-discuss] Triangulate between pairs of distance curves, Dov Grobgeld, 01/13/2021
- Re: [cgal-discuss] Triangulate between pairs of distance curves, Sebastien Loriot, 01/21/2021
Archive powered by MHonArc 2.6.19+.