Hi, It's been a while since I wrote that code, but if I remember correctly for arc-arc intersections during flattening I assign the arc index of the preceding (first) arc. Assinging 0 for arc-arc intersections during clipping isn't ideal indeed, but the intersection is (almost) never on the arc (as the flattened segment is not on the arc except for its endpoints), so assigning it the arc index would lead to an invalid arc being reconstructed (I've found this out the hard way too, but it's actually...
Hi, I leave those .Z coordinates at 0. I don't treat arc-arc intersections in anyway special, as those points do not belong to the original arc, or at least it's very unlikely that they belong to the orignal arc (due to the flattening of course). So when I collect the points and convert them back to segments any arc-arc intersections will get converted to straight segments leading up to the original arc.
Hi, During flattening I create an array of the supporting circles for any arc segments and store the index into this array into the .Z coordinate of the (flattened) arc segments. I mark the endpoints of straight segments with (1 << 63). During intersections I also mark intersections of straight lines with (1<<63). During reconstruction I can now determine whether a segment comes from an arc and what the supporting circle is. As long as the .Z coordinate doesn't change they all belong to the same...
Hi, I've reproduced my situation and can confirm that if I let it run for a few hours it will indeed run to completion! Maybe we need to redefine 'infinite' here a little bit. Would be great if this part of the algorithm can be sped up a little bit.
Hi, I just want to add that I've also been able to get Clipper into an infinite loop (C++ version). I did a single union operation on a lot of paths. Performing the operation by adding a path at at time resulted in the correct output. I did not further investiagte this issue, and I'm not sure whether I can reproduce it, but I thought it might be helpful to know that there are other occasions to get Clipper into a loop. Regards, Remco Poelstra
Hi, Good to see there is work on the code again! I would also like to vote for the return of the Z callback, as I need support for circular segments. May I also suggest the attached patch? It merely moves some templated functions from the .cpp to the .h file, as the compiler from Xcode doesn't seem to like the templated functions in the C file. Thanks! Kind regards, Remco Poelstra
Hi all, I’m using the Clipper2 from SVN and I’m trying to use the PolyTree structure. As soon as I add the following line: clipperlib::PolyTreeI polyTree; I get the following error: Undefined symbols for architecture x86_64: "clipperlib::PolyTree<long long>::PolyTree(double)” How can I solve this problem? The constructor seems to be defined in clipper.cpp just fine. Thanks in advance. Kind regards, Remco Poelstra
Hi Andy, Never mind, I found the error. I called the counter i not index. I don't know why the compiler couldn't just tell me that index doesn't exist. I'm sorry. Kind regards, Remco Poelstra