<div dir="ltr">Thanks anyway Robert,<div><br></div><div>I was counting from someone else from the community too, someone that might have experience with this piece of the code. </div><div><br></div><div>I went to reading the code indeed and I managed it. </div><div><br></div><div>Nick</div><div><br></div><div>p.s. osgUtil::Delaunay* are really cool written classes!</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Nov 12, 2016 at 10:38 AM, Robert Osfield <span dir="ltr"><<a href="mailto:robert.osfield@gmail.com" target="_blank">robert.osfield@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Nick,<br>
<br>
The original author of DelaunayTriangulator hasn't been an active<br>
member of the OSG for decade so it's unfortunately a case of reading<br>
the code to work out what is happening.<br>
<br>
I'm afraid it doesn't make much sense for me to go read your code,<br>
read the DelaunayTriangulator code and work out what is going on, then<br>
try to communicate my findings to you, it's just way more efficient to<br>
dive into the code yourself.<br>
<br>
Robert.<br>
<br>
On 11 November 2016 at 18:18, Trajce Nikolov NICK<br>
<div><div class="h5"><<a href="mailto:trajce.nikolov.nick@gmail.com">trajce.nikolov.nick@gmail.com</a><wbr>> wrote:<br>
> Hi Community,<br>
><br>
> I hope you will help this time too. Struggling again :-).<br>
><br>
> I am trying to add cultural features to terrain models, nothing fancy (yet!<br>
> :-) ) it is simple. Code will describe it more how I am doing it but it is<br>
> the very basic, elevations array to be triangulated with some constraints.<br>
> And it works nicely. However when I want to cut the triangulated constraint<br>
> from the terrain, and add this cut triangles as separate primitive set,<br>
> constraint->getTriangles() is empty. Based on the doxygen in the header I am<br>
> expecting to have these triangles there:<br>
><br>
> /** Get the filling primitive. One:<br>
> * triangulate must have bneen called and<br>
> * two: triangle list is filled when<br>
> * DelaunayTriangulator::<wbr>removeInternalTriangles is called.<br>
> * These return the triangles removed from the delaunay triangulation by<br>
> * DelaunayTriangulator::<wbr>removeInternalTriangles. */<br>
> inline const osg::DrawElementsUInt *getTriangles() const { return<br>
> prim_tris_.get(); }<br>
><br>
> No triangles when calling this and this is the snippet:<br>
><br>
> osg::ref_ptr<osgUtil::<wbr>DelaunayTriangulator> triangulator = new<br>
> osgUtil::DelaunayTriangulator;<br>
><br>
> osg::ref_ptr<osg::Vec3Array> polyline = getPolylineVertices(line);<br>
> osg::ref_ptr<osg::Vec3Array> polylineEdges = getEdges(polyline);<br>
><br>
> constraint->setVertexArray(<wbr>polylineEdges);<br>
> constraint->addPrimitiveSet(<wbr>new osg::DrawArrays(GL_LINE_LOOP, 0,<br>
> polylineEdges->size()));<br>
><br>
> triangulator-><wbr>addInputConstraint(constraint)<wbr>;<br>
> triangulator-><wbr>setInputPointArray(_points);<br>
> triangulator->triangulate();<br>
> triangulator-><wbr>removeInternalTriangles(<wbr>constraint);<br>
><br>
> osg::ref_ptr<osg::Geometry> geometry = new osg::Geometry;<br>
> geometry->setVertexArray(_<wbr>points);<br>
> geometry->addPrimitiveSet(<wbr>triangulator->getTriangles()); // triangles with<br>
> constraint cut<br>
> geometry->addPrimitiveSet(<wbr>constraint->getTriangles()); // no triangles<br>
><br>
> Thanks a bunch as always!<br>
><br>
> Nick<br>
><br>
> --<br>
> trajce nikolov nick<br>
><br>
</div></div>> ______________________________<wbr>_________________<br>
> osg-users mailing list<br>
> <a href="mailto:osg-users@lists.openscenegraph.org">osg-users@lists.<wbr>openscenegraph.org</a><br>
> <a href="http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org" rel="noreferrer" target="_blank">http://lists.openscenegraph.<wbr>org/listinfo.cgi/osg-users-<wbr>openscenegraph.org</a><br>
><br>
______________________________<wbr>_________________<br>
osg-users mailing list<br>
<a href="mailto:osg-users@lists.openscenegraph.org">osg-users@lists.<wbr>openscenegraph.org</a><br>
<a href="http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org" rel="noreferrer" target="_blank">http://lists.openscenegraph.<wbr>org/listinfo.cgi/osg-users-<wbr>openscenegraph.org</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">trajce nikolov nick<br></div>
</div>