Peter Clifton [Sun, 26 Feb 2017 14:34:16 +0000 (26 14:34 +0000)]
Fix drawing API wrappers to be static inline
Just inline on its own is wrong, since if the compiler decides NOT to inline
the function, it needs to find an implementation at link-time. Since none of
the places which include this header provide "extern" linkage for the inline
functions. This results in a link error.
Reported-by: Charles Parker <parker.charles@gmail.com>
NB: When this is confirmed to work, I will roll it into the original places
these wrappers were added.
Peter Clifton [Sat, 25 Feb 2017 16:15:20 +0000 (25 16:15 +0000)]
Disable unused parameter warnings
Peter Clifton [Sun, 1 Jan 2017 00:43:29 +0000 (1 00:43 +0000)]
Fix a degenerate case in tesselation start, plus some fixes and cleanups to squash in
Looks like numerical imprecision as the traced contour wraps around in u,v space
may lead to nearly coincident start/stop events on the u=0 line being sorted out
of the correct topological order.
Skip over them! (NB: It might be possible there are cases with further degenerecies
that this also causes inversion for?)
Also - some attempts at fixing inverted spherical surface rendering.
PROBABLY WRONG SO FAR...
Need to consider topological winding order of contours which trace entirely within
the u,v region, inside/outside. First attempt computes area - but may get it wrong
for u,v spaces which wrap. Toroids could potentially also be affected, but at the
moment - the attempted fix looks at spherical surfaces.
Need to check that we cope with spherical surfaces bounded by a single contour,
bisecting the surface - perhaps along a line of v=constant? (u-wrap)?
Need to investigate why the tesselation looks ragged for certain facing edges
of a hole cutout within the u,v plane. (See sphere tesselation at top of Neon.step)
Peter Clifton [Sat, 31 Dec 2016 14:43:57 +0000 (31 14:43 +0000)]
Fix ellipse sampling
Peter Clifton [Fri, 30 Dec 2016 19:01:18 +0000 (30 19:01 +0000)]
Add rudimentary spherical surface support
Peter Clifton [Fri, 30 Dec 2016 14:14:04 +0000 (30 14:14 +0000)]
Toroidal surfaces starting to work now
Peter Clifton [Thu, 29 Dec 2016 13:32:32 +0000 (29 13:32 +0000)]
Debug changes
Peter Clifton [Mon, 26 Dec 2016 04:12:55 +0000 (26 04:12 +0000)]
Initial prod at toroidal surfaces
(Badly broken at the moment)
Peter Clifton [Thu, 29 Dec 2016 13:31:25 +0000 (29 13:31 +0000)]
Use surface_orientation_reversed for planes
This keeps implementations for various surface types more similar,
and helps to ensure the same parameterisation of planes is used
as in the original model. (No current reason this helps, but it
feels like it might be a good idea in the long run).
Peter Clifton [Mon, 26 Dec 2016 02:12:02 +0000 (26 02:12 +0000)]
Play with ligting (kludges)
Peter Clifton [Mon, 26 Dec 2016 02:11:16 +0000 (26 02:11 +0000)]
Add basic conical surface support
Peter Clifton [Sun, 25 Dec 2016 22:11:16 +0000 (25 22:11 +0000)]
Normalise plane reference directions emitted
This fixes our rendering of our own exported models. Probably we
should also normalise direction vectors as we load the board.
Most CAD software seems to cope with the non-normalised directions
so we probably ought to as well.
Peter Clifton [Sun, 25 Dec 2016 19:10:41 +0000 (25 19:10 +0000)]
Add colour to STEP model rendering
Peter Clifton [Sun, 18 Dec 2016 19:36:45 +0000 (18 19:36 +0000)]
More restructuring on 3D model rendering
Peter Clifton [Sat, 17 Dec 2016 18:49:04 +0000 (17 18:49 +0000)]
Try to deal with faces as well as edges
Peter Clifton [Sun, 6 Mar 2016 14:59:08 +0000 (6 14:59 +0000)]
Toy rendering attempt
Peter Clifton [Sat, 12 Mar 2016 16:15:30 +0000 (12 16:15 +0000)]
Fix some warnings due to -Wextra and -pedantic
Peter Clifton [Mon, 5 Dec 2016 22:23:41 +0000 (5 22:23 +0000)]
Patch out non-full-screen invalidates
(XXX: Probably breaks non-composited screen repaints horribly!)
Peter Clifton [Sun, 4 Dec 2016 20:31:15 +0000 (4 20:31 +0000)]
More work on line drc enforcement
Peter Clifton [Sun, 4 Dec 2016 20:31:15 +0000 (4 20:31 +0000)]
Added Point3 to AttachedLineType.. (making it an attached line-pair)
Peter Clifton [Sun, 4 Dec 2016 20:31:15 +0000 (4 20:31 +0000)]
Fix line consolidation to never treat lines with different geometry as stacked.
We previously checked this for the merge case, but failed to check for the coincident case.
Peter Clifton [Sun, 4 Dec 2016 20:31:15 +0000 (4 20:31 +0000)]
Bump circle approximation detail level for gerber export
Peter Clifton [Sun, 4 Dec 2016 20:31:15 +0000 (4 20:31 +0000)]
Reduce tolerances a smidgin
Peter Clifton [Sun, 4 Dec 2016 20:31:15 +0000 (4 20:31 +0000)]
More auto-enforce DRC changes
Peter Clifton [Sun, 4 Dec 2016 20:31:15 +0000 (4 20:31 +0000)]
Improve auto-enforce DRC algorithms (also adds support for any-direction lines)
Peter Clifton [Sun, 4 Dec 2016 20:31:15 +0000 (4 20:31 +0000)]
Add board thickness parameter to step export
Peter Clifton [Sun, 4 Dec 2016 20:31:14 +0000 (4 20:31 +0000)]
Fix timeout forced redraw to run from the main loop, not directly
This avoids us drawing when the board is in an intermediate state. Will
likely not give as much immediacy as drawing from where the graphics are
invalidated - but avoids visual artaefacts when drawing tracks with
auto-enforce DRC enabled.
Peter Clifton [Sun, 4 Dec 2016 20:31:14 +0000 (4 20:31 +0000)]
Fix undo in MoveObjectAndRubberband
XXX: Need to check if the path which previously missed
IncrementUndoSerialNumber() was doing so for a reason.
Peter Clifton [Sun, 4 Dec 2016 20:31:14 +0000 (4 20:31 +0000)]
Update netclass clearances
4.0 -> 4.5
0.2 -> 0.3
Peter Clifton [Sun, 4 Dec 2016 20:31:14 +0000 (4 20:31 +0000)]
Add options to control STEP export
Peter Clifton [Sun, 4 Dec 2016 20:31:14 +0000 (4 20:31 +0000)]
STEP: Fix STEP hole emission for holes (they may land on copper!)
Peter Clifton [Sun, 4 Dec 2016 20:31:14 +0000 (4 20:31 +0000)]
Attempt to simplify polygon vertex a little
Peter Clifton [Sun, 4 Dec 2016 20:31:14 +0000 (4 20:31 +0000)]
Attempt to fix slow STEP assembly traversal
Peter Clifton [Sun, 4 Dec 2016 20:31:14 +0000 (4 20:31 +0000)]
Conditional compile different STEP output aspects
Peter Clifton [Sun, 4 Dec 2016 20:31:14 +0000 (4 20:31 +0000)]
Disable process limits
Peter Clifton [Sun, 4 Dec 2016 20:31:13 +0000 (4 20:31 +0000)]
step: Turn off inner-layers (temporarily)
Peter Clifton [Sun, 4 Dec 2016 20:31:13 +0000 (4 20:31 +0000)]
step: Add silk output
Peter Clifton [Sun, 4 Dec 2016 20:31:13 +0000 (4 20:31 +0000)]
Fixup line rubber band code to avoid going nuts when rat-lines are present.
Peter Clifton [Sun, 4 Dec 2016 20:31:13 +0000 (4 20:31 +0000)]
Fixup undo in line clearance check code
Peter Clifton [Sun, 4 Dec 2016 20:31:13 +0000 (4 20:31 +0000)]
Fix model to sit on top of copper tracks
Peter Clifton [Sun, 4 Dec 2016 20:31:13 +0000 (4 20:31 +0000)]
hid/step: Make MAPPED_ITEM style assembly of the board
This makes loading in freecad quicker.. (for some reason it gets slow when you present it with
lots of bodies in a multi-body part).
Peter Clifton [Sun, 4 Dec 2016 20:31:13 +0000 (4 20:31 +0000)]
Export multi-body parts, not a bag of loose parts due to our incomplete step assy emission code.
Peter Clifton [Sun, 4 Dec 2016 20:31:13 +0000 (4 20:31 +0000)]
Catch incomplete step data without crashing
XXX: May be plenty of other cases where we assume certain data is present!
Peter Clifton [Sun, 4 Dec 2016 20:31:13 +0000 (4 20:31 +0000)]
Add action to set netclass
Peter Clifton [Sun, 4 Dec 2016 20:31:13 +0000 (4 20:31 +0000)]
Workaround crash freeing contour with cvc_next = -1
XXX: _WHY_ Does this occur??
Peter Clifton [Sun, 4 Dec 2016 20:31:12 +0000 (4 20:31 +0000)]
Turn on thindraw poly eye-candy
Peter Clifton [Sat, 25 Feb 2017 15:34:45 +0000 (25 15:34 +0000)]
Rework LookupConnectionByPin to use LookupConnectionByObject
Peter Clifton [Sun, 4 Dec 2016 20:31:12 +0000 (4 20:31 +0000)]
Add multi-clearance DRC (whilst drawing lines)
XXX: Adds new function LookupObject() to find.c
This would perhaps be better named "LookupConnectionByObject"
Since this patch was written, a less general function was added:
"LookupConnectionByPin", which should be removed, and usage replaced
with LookupObject
Peter Clifton [Sat, 25 Feb 2017 15:47:55 +0000 (25 15:47 +0000)]
Add warnings to IPC netlister
Peter Clifton [Sat, 25 Feb 2017 15:45:05 +0000 (25 15:45 +0000)]
Fixup IPC netlister (??? NOT SURE ???)
Peter Clifton [Sun, 4 Dec 2016 20:31:12 +0000 (4 20:31 +0000)]
Add "store_undo" parameter to some find.c functions.
Tying the store of undo information and redrawing together is unhelpful!
Peter Clifton [Sun, 4 Dec 2016 20:31:12 +0000 (4 20:31 +0000)]
Disable polygon debug gui
Peter Clifton [Sun, 4 Dec 2016 20:31:12 +0000 (4 20:31 +0000)]
Fixup model orientation harder
Be consistent with earlier work without the REVERSED_PCB_CONTOURS flag unset.
Peter Clifton [Sun, 4 Dec 2016 20:31:12 +0000 (4 20:31 +0000)]
Fixup model orientation in STEP assembly emission
Peter Clifton [Sun, 4 Dec 2016 20:31:12 +0000 (4 20:31 +0000)]
Apply modulo arithmetic when computing angles, so output stays user-friendly (and bounded)
Peter Clifton [Sun, 4 Dec 2016 20:31:12 +0000 (4 20:31 +0000)]
Add basic support for tracking rotation of elements
This allows us to orient the 3D model correctly.
TODO: Wrap-around past 360 degrees...
TODO: Consider storing the footprint internals un-rotated!
Peter Clifton [Sun, 4 Dec 2016 20:31:12 +0000 (4 20:31 +0000)]
Re-enable soldermask emission
Peter Clifton [Sun, 4 Dec 2016 20:31:11 +0000 (4 20:31 +0000)]
More changes...
Peter Clifton [Sun, 4 Dec 2016 20:31:11 +0000 (4 20:31 +0000)]
Polygon intersection additions
Peter Clifton [Sun, 4 Dec 2016 20:31:11 +0000 (4 20:31 +0000)]
Random pile of improvements, hacks and awesomeness
Peter Clifton [Sun, 4 Dec 2016 20:31:11 +0000 (4 20:31 +0000)]
Fixup square thermal polygons to use frac_circle2
The main adjustment is that callers need to add their own last vertex
in order to avoid an extraneous edge marked as being round.
XXX: Might be neater to fix this by having frac_circle just not set
the round flag on the last vertex added... we can extend the checking
code to re-use vertices if the next edge added is to be round.
Peter Clifton [Sun, 4 Dec 2016 20:31:11 +0000 (4 20:31 +0000)]
Fixup SearchObjectByLocation not to use negative layer numbers
Peter Clifton [Sun, 4 Dec 2016 20:31:11 +0000 (4 20:31 +0000)]
Make sanity checks in MoveLayerToGroup asserts.
The only caller which uses the returned group value was in the Lesstif HID,
but it did not check for the possibility of a -1 return. The -1 return was
made in the case of a precondition failure, having been passed an out-of
bound layer. (Which represents a software bug).
Remove the return -1 in favour of an assert, and introduce a similar assert
checking the validity of the group number - rather than turning the function
into a NOP if an invalid group was passed.
This is a step towards making the layer and group numbers unsigned, as
we cannot return -1 when that is done.
Peter Clifton [Sun, 4 Dec 2016 20:31:11 +0000 (4 20:31 +0000)]
Add routine for simplifying polygon contours
Peter Clifton [Sun, 4 Dec 2016 20:31:11 +0000 (4 20:31 +0000)]
Figure out netnames for exported copper, and update STEP output to include various names
Peter Clifton [Sun, 4 Dec 2016 20:31:11 +0000 (4 20:31 +0000)]
Fixup Z-coords of top-solder mask in REVERSED_PCB_CONTOURS mode
Peter Clifton [Sun, 4 Dec 2016 20:31:10 +0000 (4 20:31 +0000)]
Fix cylindrical surface orientation
Peter Clifton [Sun, 4 Dec 2016 20:31:10 +0000 (4 20:31 +0000)]
DEBUG: Polygon parentage on
Peter Clifton [Sun, 4 Dec 2016 20:31:10 +0000 (4 20:31 +0000)]
Fixup debug drawing on contours to show the circular node at their start vertex, not the end.
Peter Clifton [Sun, 4 Dec 2016 20:31:10 +0000 (4 20:31 +0000)]
Attempt to cache emission of appearances
XXX: TODO - refcounting for appearances, for now - leak them!
Peter Clifton [Sun, 4 Dec 2016 20:31:10 +0000 (4 20:31 +0000)]
Try consolidating geometry in step creation
Peter Clifton [Sun, 4 Dec 2016 20:31:10 +0000 (4 20:31 +0000)]
Try to prepend, not append to g_lists. This avoids wasting time traversing lists
Peter Clifton [Sun, 4 Dec 2016 20:31:10 +0000 (4 20:31 +0000)]
Remove spaces from STEP output (saves file size)
Peter Clifton [Sun, 4 Dec 2016 20:31:10 +0000 (4 20:31 +0000)]
TODO notes
Peter Clifton [Sun, 4 Dec 2016 20:31:10 +0000 (4 20:31 +0000)]
Remove old debug code for splicing a cylinder onto the board outline object3d
Peter Clifton [Sun, 4 Dec 2016 20:31:10 +0000 (4 20:31 +0000)]
Attempt at producing inter-layer copper with via barrels etc..!
INCLUDES:
Try prepending the stolen when concatenating geometry..
The destination objects will likely keep getting larger, so it should avoid
needing to traverse the entire list length to append data.
Possibly a circularly linked list might be more efficient here, but GLib
doesn't have a convenient implementation.
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