Questions tagged [clipperlib]

Polygon and line clipping and offsetting library (C++, C#, Delphi)

56 questions
8
votes
1 answer

Converting polygon coordinates from Double to Long for use with Clipper library

I have two polygons with their vertices stored as Double coordinates. I'd like to find the intersecting area of these polygons, so I'm looking at the Clipper library (C++ version). The problem is, Clipper only works with integer math (it uses the…
tommaisey
  • 449
  • 2
  • 10
7
votes
1 answer

Parallel line using Clipper library

I'm using CLIPPER library to offset line and trying to make parallel line. ClipperOffset co = new ClipperOffset(); co.AddPath (s, JoinType.jtRound, EndType.etOpenRound); co.Execute (ref solution, 15); Result is right image in attachment. I need…
seek
  • 1,065
  • 16
  • 33
7
votes
3 answers

Merging touching polygons giving wrong result

I'm trying to write a piece of code that given a list of polygons (defined as a list of lists of IntPoints) checks if any of them touch and if so merge them into a single polygon. In order to do this I have already tried the following two methods:…
Thijser
  • 2,625
  • 1
  • 36
  • 71
6
votes
1 answer

Odd "notches" in Polygon when using OffsetPolygon from Angus Johnsons's Clipper lib

The eventual goal of this code is to make sure the customer is defining shapes that can actually be machined by our... uh, machines. To do this, we are offsetting the specified shape inward by the radius of the bit and then back outward that same…
Mike M
  • 63
  • 4
5
votes
1 answer

Intersection between polygons as line Clipper

I'm trying to use the Clipper C++ library to implement an is_bordering function, as shown below. bool is_bordering(Path p1, Path p2) { Paths solutions; Clipper c; // execute intersection on paths c.AddPath(p1, ptSubject, true); …
k-a-v
  • 326
  • 5
  • 22
5
votes
1 answer

Point in polygon hit test algorithm

I need to test if a point hits a polygon with holes and isles. I'd like to understand how I'm supposed to do this. That's not documented and I can't find any explanation or examples. What I do is count +1 for every outer polygon hit and -1 for every…
pid
  • 11,472
  • 6
  • 34
  • 63
4
votes
1 answer

Difference between ptSubject and ptClip in ClipperLib

when polygon1 and polygon2 contains the same Coordinates (10,10) (20,10) (20,20) (10,20) Clipper c; c.AddPaths(polygon1,ptSubject); c.AddPaths(polygon2,ptClip); c.Execute(ctUnion,polyUnion,pftNonZero,pftNonZero); polygon1 and polygon2 are Closed…
AravindK
  • 151
  • 8
4
votes
1 answer

Is it possible to check if a polygon intersects with itself using Clipper?

Can I use Clipper to check if my polygon contour intersects with itself (if it is a complex or a simple polygon)? I know that it does not make the polygon invalid, but in my case I want to avoid self intersecting polygons.
arthur.sw
  • 11,052
  • 9
  • 47
  • 104
4
votes
1 answer

C# clip linesegment with clipper library

I am using clipper for performing a bunch of operations on polygons which represent the outlines of objects in my program. The thing is, I now want to clip a grid of line segments to fill these outlines but I am struggling to do this with…
Gerharddc
  • 3,921
  • 8
  • 45
  • 83
3
votes
1 answer

Anything wrong with my code:"clipping polygon(ellipse points) with line segments(subject) with clipper library in c#"

1.I'm drawing an ellipse and lines on a PictureBox. 2.I'm getting Paths object count as zero after performing clipper.PolyTreeToPaths(polytree_solution);see the contents 3.PolyTree object contains this see the contents. I know my question is similar…
thippu
  • 75
  • 9
3
votes
0 answers

Merging polygons on curved surface

I tried the clipper library for merging polygons (c#) that I want to import into Google Earth. It worked with a flat-surface sample of two circles, but there are two problems with using longitute and latitude as X and Y: Clipper only supports long…
fnx
  • 451
  • 4
  • 15
3
votes
2 answers

union of googlemaps polygons with clipper.js

I'm trying to merge 2 polygons (green) on Google maps (API v3 Javascript) with clipper.js. before : http://jsfiddle.net/kevdiho/tc53Y/ My goal is to have only 1 polygon (red). The problem is that the final polygon is not exactly follow the path and…
madiknight
  • 85
  • 3
  • 5
3
votes
1 answer

Polygon difference - strange results from Clipperlib

I am trying to create iso-area polygons ("donuts") from a set of contours. This is the process: Generate the contours. Sort the contours into a tree structure, such that all contours held within a specific contour are children of that contour. For…
Matt
  • 687
  • 5
  • 17
2
votes
2 answers

Extract contour path from an image

Let's say I have a 16x16 black & white bitmap image Here white pixels indicate empty space and black pixels indicate filled space. I want to extract all of it's contour lines that surround black pixels, including holes and nested contour lines.…
2
votes
2 answers

Memory adress output instead of value

The program output is : std::vector(0x55f164f79450) instead of Childs[one]: What am i doing wrong here? Any help would be appreciated ! The online example…
max
  • 21
  • 2
1
2 3 4