Recent posts to Discussionhttps://sourceforge.net/p/polyclipping/discussion/Recent posts to DiscussionenFri, 26 Aug 2016 09:53:47 -0000problem in joining polygons https://sourceforge.net/p/polyclipping/discussion/1148419/thread/088e13e0/<div class="markdown_content"><p>hi, Im Sarathy</p>
<p>List of Polygons<br/>
1. (399,2586),(4142,2586),(399,399)<br/>
2. (4142,2586),(6469,2586),(6469,400),(399,399)<br/>
3. (1279,2586),(1279,3945),(6469,3945),(4142,2586)<br/>
4. (4142,2586),(6469,3945),(6469,2586)<br/>
5. (1279,3332),(399,3332),(399,3945),(1279,3945)<br/>
6. (833,3332),(833,2586),(399,2586),(399,3332)</p>
<p>Clipper c = new Clipper()<br/>
c.AddPaths(polygons,pt.subject,true)<br/>
c.Execute(ct.union,solution,pftNonZero,pftNonZero);</p>
<p>acutal result <br/>
<strong><em>_</em></strong><strong><em>_</em></strong><strong><em> <br/>
</em></strong><strong><em>_</em></strong><strong><em>_</em></strong> <br/>
| | | |<br/>
| <strong><em> | | <br/>
</em></strong> |<br/>
| | | | | | | | <br/>
|_ |<strong><em>| | | |</em></strong>| |<br/>
| | | |<br/>
|<strong><em>_</em></strong><strong><em>_</em></strong><strong>| |<strong><em>_</em></strong><strong><em>_</em></strong></strong>|<br/>
fig1 fig2</p>
<p>i contruct the polygon around the hole and i tired to union it,<br/>
im not getting excepted result (fig 2). i want to know that whether it can or cannot <br/>
or is there any way do this.</p>
<p>version no:below 4</p></div>Sarathy spFri, 26 Aug 2016 09:53:47 -0000https://sourceforge.net3d59067b11f7cc5a0ae2c4d6d8ab441d0761e484parent child relationship from a number of closed pathshttps://sourceforge.net/p/polyclipping/discussion/1148419/thread/5bcd6ce4/<div class="markdown_content"><p>Clipper makes those relationships automatically if you use PolyTree as a solution structure instead of Paths. Something like:</p>
<p>Clipper c = new Clipper();<br/>
PolyTree solution = new PolyTree();<br/>
c.AddPaths(subj, PolyType.ptSubject, true); // subj is your source paths as Paths structure<br/>
c.Execute(ClipType.ctUnion, solution);</p>
<p>Solution PolyTree is now filled with data representing the solution. Execute() makes an UNION operation, so it can change your coordinates in case of overlapping source polygons. But if none are overlapping, it just organizes the paths to represent their parent-child relationships.</p></div>TimoSun, 10 Jul 2016 01:22:42 -0000https://sourceforge.net8106576ca986f700aebc28d5faed189738b80dcdparent child relationship from a number of closed pathshttps://sourceforge.net/p/polyclipping/discussion/1148419/thread/5bcd6ce4/<div class="markdown_content"><p>Hello forum,</p>
<p>I have several closed paths generated with another API. I want to use clipper to create the parent-child relationship among these closed paths. All the closed paths are separated and not self-intersecting.</p>
<p>Thanks</p></div>sajjadTue, 07 Jun 2016 08:48:26 -0000https://sourceforge.net20979bf84907014fddaef77e3497b735653e149eDistribution.https://sourceforge.net/p/polyclipping/discussion/1148419/thread/610749fb/<div class="markdown_content"><p>if you can understand the fragments of his code his distribution terms are most generous to allow you to write even your own and palm it off as your creation.<br/>
best of luck.</p></div>Mahesh NaikMon, 06 Jun 2016 10:31:32 -0000https://sourceforge.netefce32376e1724f5412cd4765beb12947b7df534Distribution.https://sourceforge.net/p/polyclipping/discussion/1148419/thread/610749fb/<div class="markdown_content"><p>It would seem so.<br/>
The Homepage states it is "Freeware for both open source and commercial applications "<br/>
<a class="" href="http://" rel="nofollow">http://www.angusj.com/delphi/clipper.php</a><br/>
Under the Boost Licence<br/>
<a class="" href="http://" rel="nofollow">http://www.boost.org/LICENSE_1_0.txt</a></p>
<p>Cheers</p></div>Paul GreenThu, 02 Jun 2016 08:51:13 -0000https://sourceforge.net1e264164bac3e2ecc5ed95d1a1587bbd3d88fdd1Help with basics of ClipperOffset(), ClipType.ctUnion resultshttps://sourceforge.net/p/polyclipping/discussion/1148419/thread/85477a22/<div class="markdown_content"><p>As a for instance, I am trying to use ClipperOffset() to "expand" a section of river from real-world data, which is a closed polygon (~900 verticies) & has no "holes". I am successfully triangulating & rendering it, it looks fine, so I assume it is not self-intersecting... In my attempts to use ClipperOffset() I am getting a result of 70+ List<IntPoint>'s, so is this likely to be correct and I don't know how to correctly merge the results, or is it likely bad/incompatible data? Thanks.</p></div>gorseSat, 28 May 2016 20:59:50 -0000https://sourceforge.net02ee9bbdd6dd873c8684d83a1af11debbed37568Help with basics of ClipperOffset(), ClipType.ctUnion resultshttps://sourceforge.net/p/polyclipping/discussion/1148419/thread/85477a22/<div class="markdown_content"><p>Hi there,</p>
<p>I am currently playing with ClipperOffset() in C# and am having trouble understanding the basics.</p>
<p>I feed it a List of IntPoints, all sorted by winding order, ok, and I get a List<List<IntPoint>> back.</p>
<p>What exactly does this list of lists represent? I would expect the “same" list of points back, with their values offset by the delta. Can I somehow achieve this with Clipper?</p>
<p>Similarly, if I take this result and conduct a ClipType.ctUnion on them, I would expect to get back one “unified” polygon, not another list of lists...</p>
<p>Clearly I am not understanding something fundamental here, sorry :)</p>
<p>My problem is, I need to feed these results back into some graphics software as a 1d list with the winding order preserved, and I can’t see how I can hope to merge these disparate result lists into one de-duplicated list with the points in the correct winding order, that a subsequent Delaunay Triangulation demands.</p>
<p>Thanks in advance for any help!<br/>
jon</p></div>gorseFri, 27 May 2016 16:50:22 -0000https://sourceforge.netf3ef31d2ec5953d322ff39c8ce2abe0f676b2dc4Distribution.https://sourceforge.net/p/polyclipping/discussion/1148419/thread/610749fb/<div class="markdown_content"><p>Hi, this is extremely useful software.<br/>
Can I make a product using it (source distributable), if I keep everything absolutely intact, including the comments?<br/>
Thanks.</p></div>Dave HoskinsTue, 24 May 2016 20:18:38 -0000https://sourceforge.netd9c96097b26d3c1c1366aa8e8d51d260b34f49aefill a closed path with fractal pathhttps://sourceforge.net/p/polyclipping/discussion/1148419/thread/5398fd3e/<div class="markdown_content"><p>Hello forum,</p>
<p>I have generated an open path based on Hilbert Curve. Now I want to fill the closed polygon path with the hilbert pattern. And then later I want to add offset to both the outer and inner polygons and then fill with the hilbert pattern. </p>
<p><a class="" href="http://imgur.com/CMYHrtZ" rel="nofollow">Hilbert Pattern</a></p>
<p><a class="" href="http://imgur.com/NTtPYoB" rel="nofollow">Filled Pattern</a></p>
<p>Which class structure within the clipper library shall serve the purpose ? Please do let me know if I have not explained the issue clear enough for you.</p>
<p>Thanks</p></div>sajjadTue, 24 May 2016 13:36:00 -0000https://sourceforge.net0fcfe9c2adc03b695a6a7c3369007086ab191073compute volume between two 3D mesheshttps://sourceforge.net/p/polyclipping/discussion/1148419/thread/dd67cfe3/<div class="markdown_content"><p>I need to compute the volume between 2 3D meshes. My algorithm is to find the intersection between the two (where one is always larger on the XY plane than the other) by using Clipper, and then find the difference between the volumes under the solution's mesh and the smaller of the two meshes. I'm setting use_xyz and assuming that Clipper will keep my input z values and then call the ZFillFunction when it's interpolating points. I'm also assuming that the input bot1-top1 and bot2-top2 are two different edges and I can pick either edge to interpolate z. Is my understanding correct?</p>
<div class="codehilite"><pre> Clipper clipper = new Clipper();
clipper.ZFillFunction = MyZFillCallback;
Poly inner = DTriangListToTriList(innerTris);
Poly outer = DTriangListToTriList(outerTris);
Poly solution = new Poly();
clipper.AddPaths(outer, PolyType.ptSubject, true);
clipper.AddPaths(inner, PolyType.ptClip, true);
clipper.Execute(ClipType.ctIntersection, solution);
// convert polys back to triangles
ArrayList result = new ArrayList();
foreach (List<IntPoint> poly in solution)
{
result.AddRange(PolyToDTriangles(poly));
}
private void MyZFillCallback(IntPoint bot1, IntPoint top1,
IntPoint bot2, IntPoint top2, ref IntPoint pt)
{
try
{
if (bot1.X == top1.X || bot1.Y == top1.Y)
pt.Z = bot1.Z;
else
{
// parametric equations
// x=x0+t(x1-x0)
// y=y0+t(y1-y0)
// z=z0+t(z1-z0)
double t1 = (pt.X - bot1.X) / (top1.X - bot1.X);
double t2 = (pt.Y - bot1.Y) / (top1.Y - bot1.Y);
pt.Z = (Int64)(bot1.Z + t1 * (top1.Z - bot1.Z));
}
}
catch (Exception e)
{
_logger.Error(e.Message, e);
}
}
</pre></div>
</div>MikeFri, 13 May 2016 14:52:56 -0000https://sourceforge.net73fddab480921c9f84e8048cb491f5f5f54ad0b2