Commit Graph

851 Commits (a425395fe34111d15cc21ecb33906aad451e9c83)

Author SHA1 Message Date
Jonathan Westhues 52f9be0925 Add projected point-point distance constraint.
[git-p4: depot-paths = "//depot/solvespace/": change = 2115]
2010-01-27 10:15:06 -08:00
Jonathan Westhues 46cabb4d73 Oops, feeding garbage to the SolveSpace file load routines would
make it return with the program in a bad state and blow up later;
so fix at least one easy case of that.

[git-p4: depot-paths = "//depot/solvespace/": change = 2114]
2010-01-24 17:32:36 -08:00
Jonathan Westhues c95e5c1614 And fix the convenience functions and example, to specify a normal
with the arc of a circle.

[git-p4: depot-paths = "//depot/solvespace/": change = 2113]
2010-01-22 22:40:10 -08:00
Jonathan Westhues c440a6b687 And fix some typos in that documentation for the SolveSpace
library, and stub out a function to make it build again.

[git-p4: depot-paths = "//depot/solvespace/": change = 2112]
2010-01-22 19:47:00 -08:00
Jonathan Westhues cbbad624ac Oops, documentation for SolveSpace library failed to mention that
normal must be specified for arcs.

[git-p4: depot-paths = "//depot/solvespace/": change = 2111]
2010-01-22 19:26:05 -08:00
Jonathan Westhues 66abc19ef1 Reduce the solver convergence tolerance by a factor of 100, to
just LENGTH_EPS/1e2. At least in theory, that should still be
more than enough; all we need is for equal things to be equal
afterward, and even LENGTH_EPS/2 would guarantee that.

[git-p4: depot-paths = "//depot/solvespace/": change = 2110]
2010-01-18 02:28:47 -08:00
Jonathan Westhues 7337b23f0f Edit Message() and Error() strings to use just \n, not \r\n, since
my own dialog boxes don't require the carriage returns.

[git-p4: depot-paths = "//depot/solvespace/": change = 2109]
2010-01-16 10:15:40 -08:00
Jonathan Westhues aaf0984882 Replace standard message boxes with my own, which will word-wrap
consistently across multiple versionf of Windows, and perhaps not
be immediately ignored by the user.

[git-p4: depot-paths = "//depot/solvespace/": change = 2108]
2010-01-16 01:22:44 -08:00
Jonathan Westhues 342729d9a4 Indicate the just-exported origin and basis x and y vectors after
exporting our view to any file that doesn't have a canvas size (and
therefore doesn't get everything shifted to fit with the requested
margins around it in the canvas).

[git-p4: depot-paths = "//depot/solvespace/": change = 2107]
2010-01-13 21:24:32 -08:00
Jonathan Westhues a0a7feda89 Add G Code export to SolveSpace, similar to SketchFlat. This
requires user interface to specify the depth, number of passes,
feed, and plunge feed, unfortunately.

[git-p4: depot-paths = "//depot/solvespace/": change = 2106]
2010-01-13 20:47:17 -08:00
Jonathan Westhues e8b0cd1f9d Oops, don't allow the user to type a zero or negative scale in the
view screen.

[git-p4: depot-paths = "//depot/solvespace/": change = 2104]
2010-01-10 16:44:11 -08:00
Jonathan Westhues 5302aad1cc Hide the text or graphics edit control when the user left-clicks
somewhere in the text or graphics window. Previously, those
left-clicks just did nothing.

[git-p4: depot-paths = "//depot/solvespace/": change = 2100]
2010-01-08 01:55:22 -08:00
Jonathan Westhues 0f8c303b2e Oops, it was possible to edit the dimension for any constraint, not
just those that actually have associated dimensions. Amazing how
long that bug's been sitting there.

[git-p4: depot-paths = "//depot/solvespace/": change = 2099]
2010-01-08 01:40:47 -08:00
Jonathan Westhues ae5b297475 Add warning when user tries to toggle construction with nothing
selected.

[git-p4: depot-paths = "//depot/solvespace/": change = 2097]
2010-01-07 00:02:13 -08:00
Jonathan Westhues 2eff68409e Make the view screen alternate light and dark background, same as
everything else.

[git-p4: depot-paths = "//depot/solvespace/": change = 2096]
2010-01-03 23:07:35 -08:00
Jonathan Westhues 58c0e44107 Leave the just-pasted entities selected after a Paste Transformed.
[git-p4: depot-paths = "//depot/solvespace/": change = 2095]
2010-01-03 19:17:09 -08:00
Jonathan Westhues 3a2ec4630e Update the version number for SolveSpace, to 1.6.
[git-p4: depot-paths = "//depot/solvespace/": change = 2094]
2010-01-03 17:06:17 -08:00
Jonathan Westhues ba8ac7dcd3 Add a screen to edit the view parameters; scale, translation,
rotation. Also clean up the handling of units, by putting the
conversion factors in only one place, and clean up the
expression-parsing but removing all the copies of the same error
message.

[git-p4: depot-paths = "//depot/solvespace/": change = 2093]
2010-01-03 16:35:28 -08:00
Jonathan Westhues a4a1d3b619 Remove the toggle semantics from all the selection stuff. Now
left-clicking always selects, and there's a special context menu
item to deselect. Also streamline the right-click behavior by
making that select the hovered item, and making all the context
menu items work on the selection.

[git-p4: depot-paths = "//depot/solvespace/": change = 2091]
2010-01-03 02:26:15 -08:00
Jonathan Westhues ee052b556a Tweak drag and selection behavior: selection is kept after dragging
selected entities, but cleared after dragging an unselected entity.
Marquee selection is select-only (not toggle), and "Select All"
replaces "Invert Selection". Left-click on nothing will clear the
selection.

Also add context menu entries for cut, copy, and paste.

[git-p4: depot-paths = "//depot/solvespace/": change = 2089]
2009-12-21 08:44:00 -08:00
Jonathan Westhues c225087ab5 PDF has a page size limit of 200 inches for either axis; so warn if
we exceed that, because the viewers will otherwise just silently
display nothing.

[git-p4: depot-paths = "//depot/solvespace/": change = 2088]
2009-12-15 06:51:21 -08:00
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 9723f4e44f Add support for a clipboard, with cut, copy, and paste. This works
only in a workplane; but this means that plane sketches are
conveniently transformed from one plane to another.

Also tweak snap to grid to ignore unsnappable entities instead of
triggering an error, and to remove arbitrary limit on the number of
entities / comments that will be snapped.

[git-p4: depot-paths = "//depot/solvespace/": change = 2084]
2009-12-04 00:08:41 -08:00
Jonathan Westhues c74ab47833 Don't create new line segments as zero-length when left-clicking to
draw more line segments, to avoid annoying warnings.

[git-p4: depot-paths = "//depot/solvespace/": change = 2083]
2009-12-03 11:47:44 -08:00
Jonathan Westhues 8e484beec1 Add a warning when zero-length edges appear in the sketch, since
those screw a lot of things up. And add data structure for
clipboard entities, though no code yet.

[git-p4: depot-paths = "//depot/solvespace/": change = 2082]
2009-12-03 11:14:34 -08:00
Jonathan Westhues 48b79b912c Draw the filled contours last, so that transparency (for the
default fill color for closed non-self-intersecting contours) works
correctly.

[git-p4: depot-paths = "//depot/solvespace/": change = 2081]
2009-11-29 03:20:45 -08:00
Jonathan Westhues 7a66e00865 Stop the perpendicular signs from flickering between the two
drawn orientations when u and v are equally good choices.

[git-p4: depot-paths = "//depot/solvespace/": change = 2080]
2009-11-28 18:42:50 -08:00
Jonathan Westhues b352ca785c My call to glClear (to clear the depth buffer, to place the
background image behind everything) seems to do bad things for
whatever reason. So get rid of that, and instead to a glDepthRange
to force that at the back.

[git-p4: depot-paths = "//depot/solvespace/": change = 2079]
2009-11-20 00:43:10 -08:00
Jonathan Westhues 4cfe7eea64 Split cubic splines and periodic splines too; which is a pain,
because it can't be C2 continuous after splitting (since I'm
doing uniform splines only, and the parametrization changes). So
just knock everything down to cubic Beziers.

Also draw lines to indicate angle and origin when Ctrl+dragging to
rotate in plane of screen.

[git-p4: depot-paths = "//depot/solvespace/": change = 2075]
2009-11-09 19:57:24 -08:00
Jonathan Westhues c79ca083c1 Remove dead code: the old stuff to abuse the gl triangulation
routines, since I now have my own.

[git-p4: depot-paths = "//depot/solvespace/": change = 2074]
2009-11-09 03:59:30 -08:00
Jonathan Westhues 61da5969f6 Add O(n*log(n)) self-intersection check for polygons. That was
previously a major bottleneck, and is now at least 10x faster for a
practical section.

And fix a horrible uninit memory bug in the triangle kd-tree stuff;
the split planes were apparently random. This would have slowed
things down, but not caused an incorrect result; except when it
ends up NaN, which is the reason I noticed.

[git-p4: depot-paths = "//depot/solvespace/": change = 2073]
2009-11-09 03:51:38 -08:00
Jonathan Westhues f3eeae673f Oops, wasn't clearing depth buffer after blitting background image.
[git-p4: depot-paths = "//depot/solvespace/": change = 2072]
2009-11-07 20:50:38 -08:00
Jonathan Westhues d74b1e7ece Add ability to set a background image. I import a png with libpng,
load it as a texture, and show it instead of a flat-color
background. Includes user interface to specify scale and
translation of image, but the rotation is always aligned to the
view.

[git-p4: depot-paths = "//depot/solvespace/": change = 2071]
2009-11-07 17:11:38 -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 e91bf7db79 Don't let invert selection, select edge chain, or marquee selection
work on hidden entities. Also fix bug where undo state wasn't saved
before toggling construction.

[git-p4: depot-paths = "//depot/solvespace/": change = 2067]
2009-11-03 23:59:23 -08:00
Jonathan Westhues c79604f64d Add marquee selection, a view-aligned rectangle such that
everything even partially within that rectangle gets selected when
I release.

Also make deselecting a point deselect all coincident points too;
otherwise there now exist ways to select both coincident points,
which meant that it was impossible to deselect the lower one.

And fix text window to show selection info even if just constraints
are selected, seems more consistent.

[git-p4: depot-paths = "//depot/solvespace/": change = 2066]
2009-11-03 23:52:58 -08:00
Jonathan Westhues 2ae9983f9e Add context menu item to delete a point-coincident constraint,
which can't be selected with the mouse and would otherwise have to
get deleted by selecting it in the text window.

[git-p4: depot-paths = "//depot/solvespace/": change = 2065]
2009-11-03 19:46:06 -08:00
Jonathan Westhues b9ab62ab3f Remove arbitrary limits on the selection size, and permit more than
one point to be dragged simultaneously. So now a dragged point
drags all the selected points and entities, and a dragged entity
drags its points (except for circles, which drag the radius).

This means that the number of forced points for the solver must now
be unlimited, and it is.

Also add commands to invert the selection within the active group,
and to select an edge chain starting from the current selection.
And redo the context menus a bit; still not great, but less
cluttered and more systematic.

[git-p4: depot-paths = "//depot/solvespace/": change = 2064]
2009-11-03 10:54:49 -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 daeb0e8430 Oops, was always writing SVG or EPS arcs counter-clockwise; which
breaks with the new path stuff, since circular holes really do have
to go ccw. So fix that.

[git-p4: depot-paths = "//depot/solvespace/": change = 2062]
2009-10-30 03:18:54 -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 0914a27ff4 Put information about which requests generate which entities, and
how many points are associated with each, into a single table.

[git-p4: depot-paths = "//depot/solvespace/": change = 2056]
2009-10-22 06:02:08 -08:00
Jonathan Westhues 2ca5334bdf Add interpolating splines: both periodic splines (that form a
loop), and open-ended splines, with their tangents specified at
their endpoints.

Also change constraint solver matrix size to 1024, on the theory
that a power of two will generate better array indexing, and
replace fabs() with my own function that for some reason is
faster.

[git-p4: depot-paths = "//depot/solvespace/": change = 2055]
2009-10-20 20:46:01 -08:00
Jonathan Westhues f6bb680978 Add Wavefront OBJ support, to supplement the existing STL mesh
export. That doesn't seem very useful, but it's only a few dozen
lines of code.

[git-p4: depot-paths = "//depot/solvespace/": change = 2054]
2009-10-12 03:34:43 -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 ce37b1cf72 A better fix to the display mesh issue; instead of drawing the
previous group, copy the previous group's mesh into ours, and draw
ours. This makes other stuff that uses that mesh (like the export
and analysis code) work properly.

[git-p4: depot-paths = "//depot/solvespace/": change = 2050]
2009-10-07 23:55:09 -08:00