Peter Clifton [Sun, 4 Dec 2016 20:31:09 +0000 (4 20:31 +0000)]
Extend object3d_from_contours() to have an option to produce an inverted shell contour
This will be useful when extruding voids within objects during 3D export.
Peter Clifton [Sun, 4 Dec 2016 20:31:09 +0000 (4 20:31 +0000)]
Add void *userdata member to the POLYAREA object
This is intended to allow client code operating on polygons to assign
arbitrary additional data to the polygon contours.
The initial target use-case is in 3D export code, where it is helpful to
have temporary links between POLYAREA contours being extruded and the 3D
object structures being generated. Allowing this tagging directly avoids
the need to maintain a hash-mapping or similar.
Peter Clifton [Sun, 4 Dec 2016 20:31:09 +0000 (4 20:31 +0000)]
Alter cntr_in_M_POLYAREA() to return which POLYAREA which the passed PLINE was found inside.
In the case which previously returned FALSE, where the PLINE was not found
inside any of the linked POLYAREA, the funciton returns NULL.
Peter Clifton [Sun, 4 Dec 2016 20:31:09 +0000 (4 20:31 +0000)]
Subtract vias from ...
Peter Clifton [Sun, 4 Dec 2016 20:31:09 +0000 (4 20:31 +0000)]
Rename PinPoly to PinClearPoly, re-introducing PinPoly to create the shape of the pin.
Peter Clifton [Sun, 4 Dec 2016 20:31:09 +0000 (4 20:31 +0000)]
Debug stuff
Peter Clifton [Sun, 4 Dec 2016 20:31:09 +0000 (4 20:31 +0000)]
Extend object3d code to support arc-segments in POLYAREA contours
Peter Clifton [Sun, 4 Dec 2016 20:31:09 +0000 (4 20:31 +0000)]
Remove left over debug
Peter Clifton [Sun, 4 Dec 2016 20:31:09 +0000 (4 20:31 +0000)]
Disable debug
Peter Clifton [Sun, 4 Dec 2016 20:31:08 +0000 (4 20:31 +0000)]
Copy contour is_round information when copying polygons
Peter Clifton [Sun, 4 Dec 2016 20:31:08 +0000 (4 20:31 +0000)]
Polygon debug
Peter Clifton [Sun, 4 Dec 2016 20:31:08 +0000 (4 20:31 +0000)]
XXX: THIS IS NOT TO BE EDITED, JUST A CHERRY PICKED COPY FOR DEBUG... Add polygon parentage tree debug view
NB: Also contains some probably bug fixes for PBO operations,
in particular - relating to bad exit codes when a NULL poly is
copied.
Peter Clifton [Sun, 4 Dec 2016 20:31:08 +0000 (4 20:31 +0000)]
Debug wonky copper polygon generation
Peter Clifton [Sun, 4 Dec 2016 20:31:08 +0000 (4 20:31 +0000)]
Enable output of via pads, and dial down circular approximation accuracy
Peter Clifton [Sun, 4 Dec 2016 20:31:08 +0000 (4 20:31 +0000)]
Turn off debug hacks in object generation
Peter Clifton [Sun, 4 Dec 2016 20:31:08 +0000 (4 20:31 +0000)]
Re-enable board core emission
Peter Clifton [Sun, 4 Dec 2016 20:31:08 +0000 (4 20:31 +0000)]
Disable small edge EPSILON hack for computing edge normals
Peter Clifton [Sun, 4 Dec 2016 20:31:08 +0000 (4 20:31 +0000)]
Prepend when adding things to lists
Peter Clifton [Sun, 4 Dec 2016 20:31:08 +0000 (4 20:31 +0000)]
hid/step: Add copper layer export to 3D model
Peter Clifton [Sun, 4 Dec 2016 20:31:07 +0000 (4 20:31 +0000)]
Comment object3d_draw_debug() call during expose
Peter Clifton [Sun, 4 Dec 2016 20:31:07 +0000 (4 20:31 +0000)]
Adjust coordinate system GOODNES KNOWS WHETHER THE GEOMETRY IS CORRECT... IDA-STEP SEEMS TO COPE THOUGH
Peter Clifton [Sun, 4 Dec 2016 20:31:07 +0000 (4 20:31 +0000)]
Extend board export
Include emission of soldermask etc..
V2: Apply the solder-mask on top of the board (core) thickness, don't shrink the core to account for it
Peter Clifton [Sun, 4 Dec 2016 20:31:07 +0000 (4 20:31 +0000)]
XXX: SEE BELOW.. Alternative, more thorough STEP export code
This has mostly been copied and refactored from the 3D code in the branch
local_customisation_pcb+gl. They MAY have diverged, and a common history
should be recreated if possible.
Peter Clifton [Sun, 4 Dec 2016 20:31:07 +0000 (4 20:31 +0000)]
Change scroll-wheel bindings to match more GTK applications
Peter Clifton [Sun, 26 Feb 2017 16:13:22 +0000 (26 16:13 +0000)]
Add STEPcode based assembly export function
Peter Clifton [Sun, 26 Feb 2017 16:13:21 +0000 (26 16:13 +0000)]
Add action to reconstruct pins / vias / holes
Peter Clifton [Thu, 2 Mar 2017 02:33:34 +0000 (2 02:33 +0000)]
Add action to break elements to pieces in place
Peter Clifton [Thu, 2 Mar 2017 02:33:34 +0000 (2 02:33 +0000)]
Add name tags for line contours (and provide partial support for arcs)
Peter Clifton [Thu, 2 Mar 2017 02:33:33 +0000 (2 02:33 +0000)]
Add name tags to contours and feature naming for pins and vias in STEP export
Peter Clifton [Thu, 2 Mar 2017 02:33:33 +0000 (2 02:33 +0000)]
step: Fixup for refactored HID / HID_DRAW API
Peter Clifton [Thu, 2 Mar 2017 02:33:33 +0000 (2 02:33 +0000)]
Add simple STEP exporter for the board outline
Peter Clifton [Thu, 2 Mar 2017 02:32:41 +0000 (2 02:32 +0000)]
Fix 3D contour export
Peter Clifton [Thu, 2 Mar 2017 02:32:41 +0000 (2 02:32 +0000)]
Refactor circular contour handling to be more generic
Peter Clifton [Thu, 2 Mar 2017 02:32:41 +0000 (2 02:32 +0000)]
Remove pseudocode for assembly emission
Peter Clifton [Thu, 2 Mar 2017 02:32:41 +0000 (2 02:32 +0000)]
Rework step generation a little
Peter Clifton [Thu, 2 Mar 2017 02:32:41 +0000 (2 02:32 +0000)]
Add wrapper function for appending to GList of step_ids stuffed into pointers.
Avoids casting
Peter Clifton [Thu, 2 Mar 2017 02:32:40 +0000 (2 02:32 +0000)]
And working again (mostly)
Peter Clifton [Thu, 2 Mar 2017 02:32:40 +0000 (2 02:32 +0000)]
Dangling fixup from old way of emitting board contours
Peter Clifton [Thu, 2 Mar 2017 02:32:40 +0000 (2 02:32 +0000)]
Well on the way to completely messing up the STEP code, just by flipping the Y coord!
Peter Clifton [Thu, 2 Mar 2017 02:32:40 +0000 (2 02:32 +0000)]
Attempt to refactor the STEP emission somewhat
Peter Clifton [Thu, 2 Mar 2017 02:32:40 +0000 (2 02:32 +0000)]
STEP changes from continue-tinkering-with-3d
Peter Clifton [Thu, 2 Mar 2017 02:32:40 +0000 (2 02:32 +0000)]
STEP changes from more-play-with-quad-edge-data
Peter Clifton [Thu, 2 Mar 2017 02:32:40 +0000 (2 02:32 +0000)]
STEP stuff from wip-on-quad-edge-play
Peter Clifton [Thu, 2 Mar 2017 02:32:40 +0000 (2 02:32 +0000)]
STEP stuff from play-with-quad-edge-data
Peter Clifton [Thu, 2 Mar 2017 02:32:39 +0000 (2 02:32 +0000)]
Remove object3d test cube and associated debug
Peter Clifton [Thu, 2 Mar 2017 02:32:39 +0000 (2 02:32 +0000)]
Splice a cylinder onto the top of the board outline (hacky test)
Peter Clifton [Thu, 2 Mar 2017 02:32:39 +0000 (2 02:32 +0000)]
Continue tinkering with 3D games
Add reversed orientation field to face3d structure
Peter Clifton [Thu, 2 Mar 2017 02:32:39 +0000 (2 02:32 +0000)]
More play with quad edge data-structures and STEP export
Peter Clifton [Thu, 2 Mar 2017 02:32:39 +0000 (2 02:32 +0000)]
Play with quad-edge data-structure - using PCB as a framework for GL!
Squashes: WIP on quad edge play
Peter Clifton [Thu, 2 Mar 2017 02:31:41 +0000 (2 02:31 +0000)]
Remove debug from outline generation
Peter Clifton [Thu, 2 Mar 2017 02:31:41 +0000 (2 02:31 +0000)]
Temporarily disable rendering short-cut for round contours
This lets us see the underlying approximation and edge data instead.
Peter Clifton [Thu, 2 Mar 2017 02:31:41 +0000 (2 02:31 +0000)]
Revert "Test routine for poly_InvContour"
This reverts commit
e1de240da219e7cd5696ed8dde04b0483abd6e54.
Peter Clifton [Thu, 2 Mar 2017 02:31:41 +0000 (2 02:31 +0000)]
Test routine for poly_InvContour
Peter Clifton [Thu, 2 Mar 2017 02:31:40 +0000 (2 02:31 +0000)]
Tag VNODEs with details of circular contour segments
The idea here is to track that the PWL segments actually came from a
particular underlying curve. This should allow us to reconstruct that
curve (approximately at least) if these segments survive in the final
polygon (are not intersected or removed by boolean operations).
The convention is that the curve shape tagging of a vertex corresponds
to the edge spanning this, and the net vertex around the list. (As per
other existing edge related flags).
NB: STILL DOES NOT WORK CORRECTLY IN ALL CASES. SEE:
circ_segs_test4_still_procuces_bad_contour_when_starting_with_arc.pcb
(SUSPECTED BUG IN THE GATHER / JUMP ROUTINES)
Peter Clifton [Thu, 2 Mar 2017 02:31:40 +0000 (2 02:31 +0000)]
Debug rendering for board outline
Peter Clifton [Thu, 2 Mar 2017 02:31:40 +0000 (2 02:31 +0000)]
More debug for circsegs stuff
Unite clearance polygons to compute a board-outline polygon...
Lets us explore operations on more specific basis.
Peter Clifton [Thu, 2 Mar 2017 02:31:40 +0000 (2 02:31 +0000)]
Invalidate board contour when a via / pin is altered
The drill-holes of vias and pins can affect the board contour
Peter Clifton [Thu, 2 Mar 2017 02:31:40 +0000 (2 02:31 +0000)]
Disable polygon heritage
Peter Clifton [Thu, 2 Mar 2017 02:31:40 +0000 (2 02:31 +0000)]
Revert "DEBUG STUFF - looking into bad polygons"
This reverts commit
292c3e44c385e3ca13127339cbfdeda1d7f6587e.
Peter Clifton [Thu, 2 Mar 2017 02:31:40 +0000 (2 02:31 +0000)]
DEBUG STUFF - looking into bad polygons
Peter Clifton [Thu, 2 Mar 2017 02:31:40 +0000 (2 02:31 +0000)]
polygon.h: Reduce circ_segs to 8 for debug clarity
Peter Clifton [Thu, 2 Mar 2017 02:31:39 +0000 (2 02:31 +0000)]
Test poly-curve support
Peter Clifton [Thu, 2 Mar 2017 02:31:39 +0000 (2 02:31 +0000)]
Limit virtual memory size of PCB process to avoid swapping my machine to death!
Sometimes the polygon code exploded...
Peter Clifton [Thu, 2 Mar 2017 02:31:39 +0000 (2 02:31 +0000)]
Add polygon parentage tree debug view
Peter Clifton [Thu, 2 Mar 2017 02:31:13 +0000 (2 02:31 +0000)]
polygon.c: Temporarily disable coalescing adjacent line segments
We need to extend the tests to properly account for arc segments.
Peter Clifton [Thu, 2 Mar 2017 02:31:12 +0000 (2 02:31 +0000)]
Compute the correct boundingbox for a polygon with arc segments.
Peter Clifton [Thu, 2 Mar 2017 02:31:12 +0000 (2 02:31 +0000)]
Temp
Peter Clifton [Thu, 2 Mar 2017 02:31:12 +0000 (2 02:31 +0000)]
Add support for arc segments in polygon object outline definitions
Test with a polygon like this:
Polygon("clearpoly")
(
[5.0000mm 7.0000mm included_angle: 90] [7.0000mm 5.0000mm]
[28.000mm 5.0000mm included_angle: 90] [30.000mm 7.0000mm]
[30.000mm 28.000mm included_angle: 90] [28.000mm 30.000mm]
[7.0000mm 30.000mm included_angle: 90] [5.0000mm 28.000mm]
)
NOTE THAT THE ARC BOUNDS ARE NOT YET INCLUDED IN THE BOUNDING BOX CALCULATION,
SO THIS WILL BREAK VARIOUS THINGS PRETTY HORRIBLY IF AN ARC PROTRUDES AS AN
EXTREME FEATURE IN EITHER THE +/-X or +/-Y DIRECTIONS.
Peter Clifton [Thu, 2 Mar 2017 02:31:12 +0000 (2 02:31 +0000)]
Fix for arc bounding box calculation split from later patch
This probably wants merging with where the problem was introduced,
but at this moment I've not had chance to review the fix is good.
Peter Clifton [Thu, 2 Mar 2017 02:31:12 +0000 (2 02:31 +0000)]
Refactor arc bounding box calculations to separate out thin case
The thin-arc case will be useful for arc-segments within polycurves.
Peter Clifton [Thu, 2 Mar 2017 02:30:47 +0000 (2 02:30 +0000)]
Fix labeling of contour which ends up as all SHARED / SHARED2, or all UNKNKWN
SHARED / SHARED2 labelling does not propagate, so if this occurs for an entire
contour, the labelling code would loop forever. (Same as if no cross-connected
vertex with definitive INSIDE / OUTSIDE information was found).
Catch when we wrap around the edge list and then decide how to classify the
whole contour. If it is all UNKNWN, we re-classify it as not intersected. The
cntr_label_POLYAREA() routine is adjusted to handle the possibility that the
label_contour() routine for ISECTED contours changes the contour status back
back to UNKNWN.
If the whole contour is SHARED or SHARED2, we leave it as ISECTED, since there
is no handling of that condition for an entire contour. (It will either be
dropped, or re-constructed, depending on the boolean operation being performed).
Peter Clifton [Thu, 2 Mar 2017 02:30:47 +0000 (2 02:30 +0000)]
Remove debug from hairline handling etc..
Peter Clifton [Thu, 2 Mar 2017 02:30:47 +0000 (2 02:30 +0000)]
Fix polygon hairline handling
Peter Clifton [Thu, 2 Mar 2017 02:30:47 +0000 (2 02:30 +0000)]
Refactor hairline edge checks
Peter Clifton [Thu, 2 Mar 2017 02:30:47 +0000 (2 02:30 +0000)]
More work in progress
Peter Clifton [Thu, 2 Mar 2017 02:30:47 +0000 (2 02:30 +0000)]
More debug stuff
Peter Clifton [Thu, 2 Mar 2017 02:30:47 +0000 (2 02:30 +0000)]
Temp attempt to try adding nodes when dealing with the inconsistent edge hairline case
Peter Clifton [Thu, 2 Mar 2017 02:30:47 +0000 (2 02:30 +0000)]
Remove debug from hairline edge code
Peter Clifton [Thu, 2 Mar 2017 02:30:46 +0000 (2 02:30 +0000)]
Work in progress
Peter Clifton [Thu, 2 Mar 2017 02:30:46 +0000 (2 02:30 +0000)]
Try to do something about the hairline edges
Peter Clifton [Thu, 2 Mar 2017 02:30:46 +0000 (2 02:30 +0000)]
TMP
Peter Clifton [Thu, 2 Mar 2017 02:30:46 +0000 (2 02:30 +0000)]
Identify and filter out shared edges within each input polygon after intersecting
Shared-edges can result from snap-rounding during intersection turning distinct
edges with similar slopes into new edges which may share identical portions.
These shared edges then confuse the polygon edge labeling code, which needs to
identify distinct spans of inside / outside each contour. As the edges are
identical, they have ambigous sort-order in the resulting CVCList.
Peter Clifton [Thu, 2 Mar 2017 02:30:46 +0000 (2 02:30 +0000)]
Temporarily disable the circular contour radius adjustment
Was part of adding arc support, now temporarily borrowed for debugging
Peter Clifton [Thu, 2 Mar 2017 02:30:46 +0000 (2 02:30 +0000)]
Allocate VNODE with g_slice_new0, rather than calloc
g_slice should be optimised for lots of small allocations - lets try this..
Peter Clifton [Thu, 2 Mar 2017 02:30:46 +0000 (2 02:30 +0000)]
polygon1.c: Move jump call to bottom of Gather..
We call Gather from Collect1, having in Collect(), established using the j_rule,
that the edge we wish to start with is not marked, and it suitable for inclusion
in the new polygon contour. (Passing what will be the resulting "from" vertex
into Collect1 to start processing).
The first step in Gather was previously a Jump call - which could switch to the
other polygon contour. (Without including our start edge). The key problem here
is that Jump makes the assumption that the vertex it is passed was reached having
been included in the resulting polygon. (It starts inspection of the CVCList from
the assumed entry edge that reached the given vertex).
In our startup condition, the vertex we pass (usually a from vertex, of a FORWARD
polygon traversal of an edge in the 'A' polygon to be included in the resulting
contour), is not necessarily preceeded by an edge on that same source contour that
will end up in the resulting polyon - leading to the possibility that Jump gets
the wrong result. (This is a by-inspection / theoretical issue, not one yet known
to cause any particular bug).
The fix is to include the edge segment we start with, BEFORE calling jump in Collect.
Once our start edge is included, the assumptions made by Jump should hold.
Peter Clifton [Thu, 2 Mar 2017 02:30:46 +0000 (2 02:30 +0000)]
Use g_critical_if_fail rather than assert for edge_label
Peter Clifton [Thu, 2 Mar 2017 02:30:45 +0000 (2 02:30 +0000)]
Attempt to splice in edge_label routine from later in patch series...
This corrects the bogus fix for hairline edges in the previous patch,
simplifying edge_label, but it DOES NOT address how to deal with these
hairline edge pairs.
With debugging on the test-cases causing problem will fail.
With arc radius compensation disabled in polygon.h, the following will
produce hairline edge pairs, and cause problems..
Via[8475.00mil 5575.00mil 40.00mil 30.00mil 0.0000 20.00mil "" ""]
Layer(1 "component")
(
)
Layer(2 "solder")
(
Line[8425.00mil 6250.00mil 8425.00mil 4475.00mil 25.00mil 30.00mil "clearline"]
Line[8475.00mil 5575.00mil 8475.00mil 4425.00mil 15.00mil 30.00mil "clearline"]
Polygon("clearpoly")
(
[6350.00mil 6650.00mil] [6350.00mil 4150.00mil] [9050.00mil 4150.00mil] [9050.00mil 6650.00mil]
)
)
The diff for polygon.h:
diff --git a/src/polygon.h b/src/polygon.h
index
a369096..
0cba2bf 100644
--- a/src/polygon.h
+++ b/src/polygon.h
@@ -37,11 +37,28 @@
#define POLY_CIRC_SEGS 8//40
#define POLY_CIRC_SEGS_F ((float)POLY_CIRC_SEGS)
+#if 0
+/* THIS IS BROKEN:
+ *
+ * IT BREAKS THE CIRCULARITY OF CIRULAR CONTORS, AS THE FIRST
+ * FIRST VERTEX ADDED BY CirclePoly IS NOT RADIUS ADJUSTED.
+ *
+ * IT BREAKS CIRCULARITY OF ALIGMENT BETWEEN A LINE AND ITS END-CAPS,
+ * LEADING TO MORE COMPLEX CONTOURS FOR COMMON LINE-LINE INTERSECTIONS,
+ * SUCH AS 90 AND 45 DEGREE ANGLES
+ *
+ * IT WAS INTENDED TO AVOID DRC ERRORS WITH "TOO-CLOSE" FEATURES,
+ * BUT COULD OTHERWISE CAUSE THEM FOR "TOO THIN" FEATURES - INSIDE/OUTSIDE
+ * CONTOUR APPROXIMATION NEEDS TO BE CONTROLED DEPENDING ON THE REQUIREMENT
+ */
/* adjustment to make the segments outline the circle rather than connect
* points on the circle: 1 - cos (\alpha / 2) < (\alpha / 2) ^ 2 / 2
*/
#define POLY_CIRC_RADIUS_ADJ (1.0 + M_PI / POLY_CIRC_SEGS_F * \
M_PI / POLY_CIRC_SEGS_F / 2.0)
+#else
+#define POLY_CIRC_RADIUS_ADJ 1.0
+#endif
/* polygon diverges from modelled arc no more than MAX_ARC_DEVIATION * thick */
#define POLY_ARC_MAX_DEVIATION 0.02
Peter Clifton [Thu, 2 Mar 2017 02:30:45 +0000 (2 02:30 +0000)]
XXX: ON REFLECTION, THIS "FIX" IS BOGUS... Fix bug in polygon contour generation
Incorrect contours were emitted in some cases when snap-rounding of vertices to
the integer grid cause coincident shared vertices from the same polygon to meet
at a cross-connected vertex.
The geometry required to create this situation is tricky, but could be provoked
in certain conditions by exactly touching line clearance polygons. (Due to
subtle rounding errors in the clearance polygons don't always meet exactly).
Distilling a simpler test case, the following polygons (on layer A and B)
should be united to reproduce the bug. (NB: The A POLYAREA has two contours
which touch at a single point):
Layer(1 "A")
(
Polygon("")
(
[51.0000mm 18.0000mm] [51.0000mm 12.0000mm] [140.0000mm 12.0000mm ] [144.0000mm 18.0000mm]
)
Polygon("")
(
[51.0000mm 6.0000mm] [144.0000mm 6.0000mm] [140.0000mm 12.0000mm] [51.0000mm 11.99996mm]
)
)
Layer(2 "B")
(
Polygon("clearpoly")
(
[139.0000mm 5.0000mm] [145.0000mm 5.0000mm] [145.0000mm 19.0000mm] [139.0000mm 19.0000mm]
)
)
In this case the two contours of the 'A' polygon each have an edge that is
horizontal (or very close to horizontal), and meet at a single point inside
the 'B' polygon contour. Due to rounding onto the integer grid, both lines
intersect the B contour at the same point, leaving two coincident edge
fragments belonging to the A contour meeting at that one vertex on the B
contour.
In the above example, operation ordering conspires to insert the two identical
A edges into the CVC list for the common intersection point on the B contour,
in an incorrect order. (They are sorted by pseudo-angles, which are identical
in this case). The reversed order of these paired edges then upsets contour
labeling in node_label().
This commit fixes node_label() to look for and skip pairs of identically angled
edges from the same polygon when iterating around the CVC list. (We can
determine the INSIDE/OUTSIDE status when we find the next, non-paired edge from
the other polygon).
Peter Clifton [Thu, 2 Mar 2017 02:30:45 +0000 (2 02:30 +0000)]
Introduce macros for traversing between edges and nodes in a specified direction
This greatly simplifies the code, at the cost of the traversal direction being
slightly less explicit.
Peter Clifton [Thu, 2 Mar 2017 02:30:45 +0000 (2 02:30 +0000)]
polygon1.c: Refactor poly_Copy0 to use poly_Create(), rather than open-coding
This ensures all polygon initialisation happens in a common place
Peter Clifton [Thu, 2 Mar 2017 02:30:45 +0000 (2 02:30 +0000)]
polygon1.c: Fix unitialised output polygon upon when hitting allocation failure
This was a bug present in the poly_Boolean() routine. We need to set the output
polygon to NULL if we are going to return early on memory failure. This was
noticed during general review after observing problems due to our copy routines
incorrectly returning FALSE when copying a NULL polygon.
Peter Clifton [Thu, 2 Mar 2017 02:30:45 +0000 (2 02:30 +0000)]
Fix return codes from poly_Copy* functions when coping NULL input polygons
Copying a NULL polygon results in a NULL return polygon. This is not an error,
so be sure to return TRUE for success, otherwise we can abort boolean
later processing incorrectly, such as in poly_Boolean and poly_BooleanFree
Peter Clifton [Thu, 2 Mar 2017 02:30:45 +0000 (2 02:30 +0000)]
polygon1.c: Remove now unused memory allocation macro MemGet
Peter Clifton [Thu, 2 Mar 2017 02:30:45 +0000 (2 02:30 +0000)]
polyon1.c: Rework InsCntr to re-use poly_Create() rather than open-coding
This allows us to ensure common initialisation is performed in poly_Create().
This commit removes the single case where the memory allocation macro MemGet
was called, which will be removed in a later commit.
Peter Clifton [Thu, 2 Mar 2017 02:30:45 +0000 (2 02:30 +0000)]
Make poly_Copy1 a static function internal to polygon1.c
Peter Clifton [Thu, 2 Mar 2017 02:30:45 +0000 (2 02:30 +0000)]
polygon.c: Refactor NoHolesPolygonDicer to call poly_Copy0 rather than poly_Copy1
poly_Copy1 is much more of an internal function to polygon1.c, and this is its
only external caller. Replace this occurance with poly_Copy0, which is intended
to be the public API.
Peter Clifton [Thu, 2 Mar 2017 02:30:44 +0000 (2 02:30 +0000)]
Attempt to fix bad rtree usage in polygon code
We need to delete the rtree entry before updating any bounds, otherwise
bad things might happen (and certainly, with NDEBUG undefined, we may
get asserts firing in rtree.c)
To avoid computational expense deleting and removing from the rtree in
the general case (where we wouldn't expect bounds to change), a new
test function has been added which determines whether the contour bounds
will be updated or not.
Peter Clifton [Thu, 2 Mar 2017 02:30:44 +0000 (2 02:30 +0000)]
Try applying Martin's upstream patch (or similar)... and see how that looks with our new macros
Peter Clifton [Thu, 2 Mar 2017 02:30:44 +0000 (2 02:30 +0000)]
Rename v->e and e->v to clairfy edge vs. vertex usage
Peter Clifton [Thu, 2 Mar 2017 02:30:44 +0000 (2 02:30 +0000)]
polygon1.c: Rename rule and v_rule to j_rule for consistency