Commit Graph

414 Commits (7a2941d2eaff100aae78fe5b846ff3e0ce345a59)

Author SHA1 Message Date
Jonathan Westhues 7a2941d2ea Add locked-where-dragged constraint to library interface, and
update some copyright dates and bad grammar in comments.

[git-p4: depot-paths = "//depot/solvespace/": change = 2137]
2010-05-06 18:13:57 -08:00
Jonathan Westhues f27b567f5c Note when an entity is construction, when we describe it in the
text window.

[git-p4: depot-paths = "//depot/solvespace/": change = 2136]
2010-05-03 21:13:35 -08:00
Jonathan Westhues 4628048d45 Add "lock point where dragged" constraint, in either 2d or 3d.
And call the cubic things splines, not segments, since that's what
they are now.

[git-p4: depot-paths = "//depot/solvespace/": change = 2135]
2010-05-03 21:11:52 -08:00
Jonathan Westhues ef7f6c6057 Oops, clear hovered icon in the text window when the mouse leaves
that window; otherwise it remains highlighted, and may even get
tooltipped.

[git-p4: depot-paths = "//depot/solvespace/": change = 2134]
2010-05-02 21:43:42 -08:00
Jonathan Westhues 7bd871ad28 Assign default name of import group based on name of imported file.
[git-p4: depot-paths = "//depot/solvespace/": change = 2133]
2010-05-02 21:38:25 -08:00
Jonathan Westhues 01ecb986f4 Instead of a "force parallel projection" menu item that's on by
default, let's do a "use perspective projection" item that's off by
default. Same meaning, but less confusion.

[git-p4: depot-paths = "//depot/solvespace/": change = 2132]
2010-05-02 21:15:28 -08:00
Jonathan Westhues 0246add3e9 Replace ugly text links to hide/show things with icons. So add code
to draw those, and hit test with the mouse, and display tool tips
when the user hovers with the mouse. Also, underline links only
when they're hovered, and not otherwise.

And add a separate menu option to align the view to the active
workplane, vs. activating the active group's workplane, and
remap the bottom two graphics window toolbar icons to that and
"nearest iso view" instead of draw in 2d/3d, since people tended
to click on those without understanding and cause trouble.

And by default, we force a parallel projection; so the factory
default camera tangent is now 0.3, not 0.

[git-p4: depot-paths = "//depot/solvespace/": change = 2131]
2010-05-02 21:04:42 -08:00
Jonathan Westhues c4b442f92f Initial work to move text window guts into platform-independent
code. This is now drawn using gl, and the bitmap font (both there
and in the graphics window) is drawn from a texture from a static
table, not from the Win32 functions, since that's ~1000x faster.

So this adds a tool to generate that table. With luck that will
also fix my font issues under WINE, which won't have to render the
TTF itself.

Still needs some cleanup, and to make all the cosmetic improvements
that I want.

[git-p4: depot-paths = "//depot/solvespace/": change = 2130]
2010-04-25 23:52:49 -08:00
Jonathan Westhues 6750995ef0 Split stuff to describe selected entity into a separate file, in
preparation for rework of text window.

[git-p4: depot-paths = "//depot/solvespace/": change = 2129]
2010-04-11 17:25:19 -08:00
Jonathan Westhues c81cbd9ee9 Add ability to measure the area of a plane sketch, since that's
easy and useful. Also make the volume measurement use Message(),
and not a separate text window screen.

And make Edit -> Unselect All (Esc) clear the marks drawn to
indicate free parameters, since it clears all the other temporary
stuff drawn in the graphics window.

[git-p4: depot-paths = "//depot/solvespace/": change = 2121]
2010-03-01 09:23:57 -08:00
Jonathan Westhues a11010c593 Fix a gross memory leak: when switching to a new file, either after
File -> New or File -> Open, I freed the Group structures
themselves, but none of their children.

[git-p4: depot-paths = "//depot/solvespace/": change = 2120]
2010-02-28 11:23:01 -08:00
Jonathan Westhues 7b10381b80 Fix bug where on-screen display of view parameters wasn't updated
after View -> Nearest Ortho/Iso.

[git-p4: depot-paths = "//depot/solvespace/": change = 2119]
2010-02-28 10:55:49 -08:00
Jonathan Westhues 54c353d403 Oops, point-symmetric-about-line constraint applies only within
workplane. Fix documentation to reflect that.

[git-p4: depot-paths = "//depot/solvespace/": change = 2118]
2010-02-28 10:52:31 -08:00
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