Commit Graph

16 Commits (7337b23f0fafbb40e5e78396e25a8df3a2d9e482)

Author SHA1 Message Date
Jonathan Westhues b974a4adeb A big nasty change, originally just to add paste transformed. So it
does that, and adds a scale factor to that transformation (instead
of just mirroring, as before), but also:

    * Replace the "import mirrored" mechanism with a scale factor,
      which if negative corresponds to a reflection as well.

    * Fix self-intersection checker to report a meaningful point
      when edges are collinear.

    * Don't blow an assertion on some types of invalid file;
      instead provide a nice error message to the user.

    * Clear the naked edges before each regen.

    * Don't create zero-length line segments by snapping a line
      segment's end to its beginning.

[git-p4: depot-paths = "//depot/solvespace/": change = 2086]
2009-12-15 04:26:22 -08:00
Jonathan Westhues 28d1bc67bc Two ugly hacks. Don't do the trick where I also deselect the point
under the just-deselected coincident point when I'm working on
batches, which really could have selected that underneath point.
And always pwl curves to at least two line segments (and likewise
retain at least one intermediate point when removing short edges),
to avoid confusion when holes end up square.

[git-p4: depot-paths = "//depot/solvespace/": change = 2070]
2009-11-05 21:34:34 -08:00
Jonathan Westhues e74a655ffd Assemble only inner loops from same style as outer loop. Fix arrows
for dimensions when viewed on edge. Add an angle measurement to the
text screen selection info.

[git-p4: depot-paths = "//depot/solvespace/": change = 2063]
2009-11-01 03:09:05 -08:00
Jonathan Westhues 3515748334 Make the EPS, PDF, and SVG targets output filled contours. This
also means that closed contours will get output as a single path
now, vs. one open path per Bezier segment before.

I've simplified the 2d/3d wireframe export targets somewhat; they
now support only Beziers, without an additional special case for
line segments. The performance penalty for that should not be worth
caring about, since that's infrequent.

And fix a memory leak in FindOuterFacesFrom(), fix ugly output of
filled triangles in PDF (because the line join style did bad things
on long skinny triangles), fix non-zero Z coordinates for exported
views or sections in DXF or STEP.

[git-p4: depot-paths = "//depot/solvespace/": change = 2061]
2009-10-30 02:38:34 -08:00
Jonathan Westhues 2f115ec950 A monster change to add support for filled paths. This requires us
to assemble Beziers into outer and inner loops, and find those
loops made up of entities with filled styles. The open paths are
maintained in a separate list, and we assemble as many closed paths
as possible even when open paths exist.

This changes many things. The coplanar check is now performed on
the Beziers, not the resulting polygon. The way that the polygon is
used to determine loop directions is also modified.

Also fix the mouse behavior when dragging a point: drop it when the
mouse is released, even if it is released outside the window, but
don't drop it if the pointer is dragged out of and then back into
our window.

Also special-case SSurface::ClosestPointTo() for planes, for speed.

[git-p4: depot-paths = "//depot/solvespace/": change = 2058]
2009-10-28 23:16:28 -08:00
Jonathan Westhues e7c8d31500 Move code to find outer and inner contours (and which inner
contours go with which outer contour) out of exportstep.cpp, since
I'll need that to do filled contour export for the 2d file formats.

Also add user interface to specify fill color.

[git-p4: depot-paths = "//depot/solvespace/": change = 2057]
2009-10-22 09:16:20 -08:00
Jonathan Westhues 83bbc004dc Add 3d wireframe export, in DXF or STEP format. This uses most of
the same plumbing as the 2d vector output.

Also fix piecewise linear tolerance when the export scale factor is
not equal to one; have to scale the chord tol along with that.

[git-p4: depot-paths = "//depot/solvespace/": change = 2053]
2009-10-12 02:40:48 -08:00
Jonathan Westhues 730bb8f73e Make the export scale factor affect the surfaces in a STEP file,
and lay groundwork for wireframe export.

[git-p4: depot-paths = "//depot/solvespace/": change = 2052]
2009-10-12 01:28:34 -08:00
Jonathan Westhues c153e23f49 Add option to mirror imported geometry, including the shell, mesh,
and parametric entities. Also consolidate the text screen functions
to change group options into a single function for everything.

[git-p4: depot-paths = "//depot/solvespace/": change = 2051]
2009-10-09 04:57:10 -08:00
Jonathan Westhues 9b8f32dad7 Now actually export the line styles, for PDF, EPS, and SVG file
formats, with the proper color and width. This may need a bit of
cleanup for stuff like the hidden line removal, which currently
loses the style.

Also fix a bug in the test for arcs of a circle. A second-order
Bezier with collinear control points really is an arc, but it's an
arc with infinite radius so stuff tends to blow up. So return false
for that one.

[git-p4: depot-paths = "//depot/solvespace/": change = 2030]
2009-09-21 21:46:30 -08:00
Jonathan Westhues 1692382d5a Replace the closed-form solutions for entity-entity splitting with
a method that works on the piecewise linear segments, and then
refines any intersections that it finds by Newton's method. So now
I support cubics too, and circle-circle intersections, and the code
is much simpler.

[git-p4: depot-paths = "//depot/solvespace/": change = 2012]
2009-07-07 00:21:59 -08:00
Jonathan Westhues 666ea1c047 Add beginnings of marching surface intersection; I can find all the
boundary points, at least. That required some changes to what gets
passed around (for example because to project a point onto this
inexact curve, we need to know which two surfaces it trims so that
we can do a Newton's method on them).

And fix stupidity in the way that I calculated edge normals; I just
did normal in uv space, and there's no particular reason why that
would be normal in xyz. So edges in long skinny surfaces failed,
for example.

[git-p4: depot-paths = "//depot/solvespace/": change = 1990]
2009-06-18 23:56:33 -08:00
Jonathan Westhues 40ed1b7ac1 Generate intersection curves for surfaces of extrusion along a
parallel axis (which are always lines parallel to that axis).

Remove short pwl segments when possible, to avoid short edges that
get misclassified.

[git-p4: depot-paths = "//depot/solvespace/": change = 1952]
2009-05-17 23:26:51 -08:00
Jonathan Westhues b5c8aade21 Add exact export of arcs for EPS, DXF, SVG, and of nonrational
polynomial curves for SVG.

[git-p4: depot-paths = "//depot/solvespace/": change = 1937]
2009-04-14 18:55:18 -08:00
Jonathan Westhues 775653a75d Add beginnings of exact curve export. We take the trim curves in
our specified section plane; we then split them according to the
start and endpoints of each STrimBy, using de Castejau's algorithm.
These sections get projected (possibly in perspective, which I do
correctly) into 2d and exported.

Except, for now they just get pwl'd in the export files. That's the
fallback, since it works for any file format. But that's the place
to add special cases for circles etc., or to export them exactly.
DXF supports the latter, but very painfully since I would need to
write a later-versioned file, which requires thousands of lines of
baggage. I'll probably stick with arcs.

[git-p4: depot-paths = "//depot/solvespace/": change = 1936]
2009-04-13 20:19:23 -08:00
Jonathan Westhues 71adc0bf54 Split ratpoly.cpp; now that contains only the mathematical stuff,
and curve.cpp and surface.cpp contain the rest.

Also get rid of the meshError stuff; will just use the nakedEdges
mechanism for that. And I won't run the interference test
continuously, have added a menu item for that.

[git-p4: depot-paths = "//depot/solvespace/": change = 1934]
2009-03-28 22:05:28 -08:00