Commit Graph

114 Commits (25ed4e1ef1f5bf666df76d08620105e3574d1eba)

Author SHA1 Message Date
Jonathan Westhues b8da4ed2b3 Split export DXF command into export section and export view, and
add framework for additional vector output formats (ps, pdf).

[git-p4: depot-paths = "//depot/solvespace/": change = 1893]
2009-01-13 21:10:42 -08:00
Jonathan Westhues ef11978d2c Add menu item to center view at a point; and move non-ID list data
structure from polygon.h into dsc.h, since it is used outside the
polygon/mesh code.

[git-p4: depot-paths = "//depot/solvespace/": change = 1892]
2009-01-12 22:56:05 -08:00
Jonathan Westhues 8d656bc600 Add feature to find the degrees of freedom; strike the
corresponding to each param from the Jacobian, and see if it loses
rank. If it does then that one was important, so it's bound. Then
display a big blue square around its point until the next normal
solve.

[git-p4: depot-paths = "//depot/solvespace/": change = 1887]
2009-01-04 04:01:46 -08:00
Jonathan Westhues 0a56a63417 Add a trim command. I can now do circles (or arcs) against lines,
or lines against lines. The constraints get rather screwed up
afterwards, of course.

So make arcs with the endpoints coincident into circles, instead
of nothings; since the first split of a circle produces that.

And don't warn after deleting just point-coincident or horiz/vert
constraints as a dependency; that's just a nuisance, because it
happens too often.

[git-p4: depot-paths = "//depot/solvespace/": change = 1884]
2009-01-03 04:27:33 -08:00
Jonathan Westhues 0f228fc0fb Add a toolbar. This requires a tool to convert my PNG icons to
tables in the code, which I have written in perl and am checking
in.

Also get WM_MOUSELEAVE events from win32, so that I can de-hover
everything when the mouse leaves the graphics window. And fix one
of the icons, which was 23x24 instead of 24x24.

[git-p4: depot-paths = "//depot/solvespace/": change = 1883]
2009-01-02 02:38:36 -08:00
Jonathan Westhues 3ae0ca8c19 Add menu items to snap view to nearest orthogonal or iso view.
[git-p4: depot-paths = "//depot/solvespace/": change = 1882]
2009-01-01 20:06:47 -08:00
Jonathan Westhues 23a4ce3697 Auto-show the text window when stepping a dimension, in addition to
auto-showing when a solve fails. And accept expressions, not just
numbers, for that new dimension value.

[git-p4: depot-paths = "//depot/solvespace/": change = 1877]
2008-09-17 02:13:37 -08:00
Jonathan Westhues 33654c7ce7 Fix the mystery bug where the display disappears. That would happen
when I get a mouse moved event with the middle button down before I
got a middle button down event; orig.proj{Right,Up} were invalid.

[git-p4: depot-paths = "//depot/solvespace/": change = 1873]
2008-08-23 17:32:25 -08:00
Jonathan Westhues 51ca96b821 Hide the sweep and helical sweep for now. Exact surfaces feel
more and more necessary, and that complicates those.

[git-p4: depot-paths = "//depot/solvespace/": change = 1872]
2008-08-21 20:24:51 -08:00
Jonathan Westhues 0c10efdab6 Add a simple license key: I take the CRC of the license info, plus
some magic numbers. This would be trivial to break, but still more
difficult than patching the binary to skip the check...

[git-p4: depot-paths = "//depot/solvespace/": change = 1853]
2008-02-09 05:52:01 -08:00
Jonathan Westhues 8fe910da4d Add feature to trace a point; so I can show the path that a
linkage traces out, and export the coordinates.

[git-p4: depot-paths = "//depot/solvespace/": change = 1846]
2008-07-20 03:27:22 -08:00
Jonathan Westhues 4afc881bf2 Add a command to create an arc that's tangent to two line segments.
This was possible before (by drawing everything explicitly), but
now it's easy.

[git-p4: depot-paths = "//depot/solvespace/": change = 1838]
2008-07-13 18:45:11 -08:00
Jonathan Westhues 88fc69116f Add tangency constraints, for line segments against arcs or cubics.
These are just a convenience, since it would be possible to get the
same result by drawing a construction line.

[git-p4: depot-paths = "//depot/solvespace/": change = 1836]
2008-07-13 04:44:05 -08:00
Jonathan Westhues 36870360cb Little stuff: show polygon assembly errors only for draw-in-plane
groups, rename "drawing" groups to "sketch" groups, and keep
assembling even after finding an open curve.

[git-p4: depot-paths = "//depot/solvespace/": change = 1835]
2008-07-13 01:57:46 -08:00
Jonathan Westhues 6269d702fb Report the number of degrees of freedom for each group.
[git-p4: depot-paths = "//depot/solvespace/": change = 1834]
2008-07-09 23:42:35 -08:00
Jonathan Westhues 7cf0deb9f4 Reassign the keyboard shortcuts so that the constraints don't all
start with Shift, since that's hard to type.

[git-p4: depot-paths = "//depot/solvespace/": change = 1831]
2008-07-09 23:06:07 -08:00
Jonathan Westhues b2f2f90a27 Add DXF export. The complexity comes from all the different ways to
specify the plane from which we want to grab the triangles. Shared
edges are then removed with the same code used to check for
watertight meshes, and the remaining edges are assembled into
polygons.

[git-p4: depot-paths = "//depot/solvespace/": change = 1823]
2008-07-07 22:30:13 -08:00
Jonathan Westhues b4a9ac993c Add export of the mesh as an STL file. That's trivial.
[git-p4: depot-paths = "//depot/solvespace/": change = 1822]
2008-07-06 01:24:31 -08:00
Jonathan Westhues fd4abd5519 Add a perpendicular constraint; identical to constraining a ninety
degree angle, but shows with a right angle symbol instead of a
numerical angle you can edit.

[git-p4: depot-paths = "//depot/solvespace/": change = 1819]
2008-07-02 01:21:29 -08:00
Jonathan Westhues b77cb053e2 Move `Solve Once Now' to the Edit menu, and call it `Regenerate';
and fix some other problems with the menu labels.

[git-p4: depot-paths = "//depot/solvespace/": change = 1815]
2008-06-30 01:34:03 -08:00
Jonathan Westhues 273339d5c4 Add TrueType font support to SolveSpace. This uses a modified
version of the code from SketchFlat, with all arbitrary limits
removed.

The TTF text is its own entity, and that entity includes the
font file basename and the text. That's an extra 128 bytes in the
entity, which is around a 50% increase, kind of a shame. It was
simple, though.

[git-p4: depot-paths = "//depot/solvespace/": change = 1814]
2008-06-30 01:09:17 -08:00
Jonathan Westhues 3ddd1703b1 Add helical sweeps. These aren't as parametric as I would have
liked, but my more parametric attempts were very difficult to use.
The pitch (both axial and radial) gets specified by typing a
distance in a textbox.

[git-p4: depot-paths = "//depot/solvespace/": change = 1804]
2008-06-23 00:25:17 -08:00
Jonathan Westhues 5a22982e05 Add sweeps. The user specifies a trajectory and a section, in two
separate groups. The section is swept normal to the trajectory,
producing a mesh. I'm doing the triangles only now, not copying
over any entities.

Also fix a bug in the PNG export; rows are 4-aligned, so that was
breaking when the width of the image wasn't divisible by four. Also
fix a bug in lathes, where it generated overlapping triangles for
one segment.

And change the groups to record both "this mesh", the contribution
due to the extrude/lathe/whatever, and the "running mesh", that we
get after applying the requested Boolean op between "this mesh" and
the previous group's "running mesh". I'll use that to make step and
repeats step the mesh too.

[git-p4: depot-paths = "//depot/solvespace/": change = 1801]
2008-06-21 02:18:20 -08:00
Jonathan Westhues ae566f0380 Link against libpng and zlib, and use that to export graphics;
basically just a screenshot, get the image from the framebuffer.

[git-p4: depot-paths = "//depot/solvespace/": change = 1797]
2008-06-18 00:35:14 -08:00
Jonathan Westhues e67ea9ca0f Add perspective, by a user-specified factor. So I have to apply
that perspective in the gl matrices, and also everywhere that I
check mouse pointer positions against the model, and for the zoom
to fit.

[git-p4: depot-paths = "//depot/solvespace/": change = 1796]
2008-06-17 11:12:25 -08:00
Jonathan Westhues 3b4aa2c2b2 Little fixes for units display, and change file format to binary
(even though it's still a text file), to avoid CRLF issue.

[git-p4: depot-paths = "//depot/solvespace/": change = 1794]
2008-06-14 15:31:36 -08:00
Jonathan Westhues d391c43bff Now display dimensions (and stuff in the text window) in the
user-selected units, and enter them the same way.

[git-p4: depot-paths = "//depot/solvespace/": change = 1792]
2008-06-14 01:51:25 -08:00
Jonathan Westhues b284baffce Treatment of numerical faces was screwy, exporting stuff in numXXX.
So fix that, and now I can simplify what's exported for an entity.

And add an extra measurement (face-face distance/angle), and some
other little stuff.

[git-p4: depot-paths = "//depot/solvespace/": change = 1789]
2008-06-12 20:41:27 -08:00
Jonathan Westhues 9bba9425be Add a special constraint type for comments; no equations, just
user-visible text. And make points hoverable/selectable even when
GW.showPoints is false, and zoom to fit before regenerating on file
open, because then we're at the right zoom level (and will use the
right pwl tolerance).

[git-p4: depot-paths = "//depot/solvespace/": change = 1788]
2008-06-12 00:58:58 -08:00
Jonathan Westhues 650e9db150 Add more measurement information about the selection. And remove
menu items for some features that I suppose I won't add, and fix
some bugs.

[git-p4: depot-paths = "//depot/solvespace/": change = 1787]
2008-06-11 23:31:41 -08:00
Jonathan Westhues d471872830 Add reference dimensions, add user-programmable lighting, and add a
configuration screen where all this can be specified.

[git-p4: depot-paths = "//depot/solvespace/": change = 1783]
2008-06-10 20:22:52 -08:00
Jonathan Westhues 8498a99588 Add preliminary lathe (solid of revolution) support. I'm generating
just the mesh, no derived entities (but I suppose that I could turn
all points into circles).

And fix some bugs where equations didn't get unique IDs, and make
it possible to lock on to the group's workplane automatically, if
you press W while free in 3d with no workplane selected.

[git-p4: depot-paths = "//depot/solvespace/": change = 1780]
2008-06-06 03:35:28 -08:00
Jonathan Westhues 8a0809e6a0 Split some large files.
[git-p4: depot-paths = "//depot/solvespace/": change = 1777]
2008-06-06 00:14:37 -08:00
Jonathan Westhues ab44c24cfc Major speedups, mostly by playing nicer with OpenGL; batch things
up more. Also change from stupid linear search lists to sorted
binary search lists, remove a stupid bug where I double-generated
entities, and don't do the triple drawing of entities (since
offsets on the Z buffer were doing the same job already).

[git-p4: depot-paths = "//depot/solvespace/": change = 1776]
2008-06-05 23:50:08 -08:00
Jonathan Westhues 48612bde3d Add undo/redo. This saves the param guesses, constraints, groups,
and requests to a separate list. It's messy, because I have to make
a deep copy (e.g. of the remap list for the groups, or Expr *
stuff) of some things. Others (e.g. the polygon or mesh) will be
regenerated, so they should be discarded, but they must not get
double-freed.

In any case, works superficially. And fix a few memory leaks
unrelated to this, and remove some dead code.

[git-p4: depot-paths = "//depot/solvespace/": change = 1775]
2008-06-04 02:22:30 -08:00
Jonathan Westhues 64c7a4e61b Fix bugs: problem drag-rotating normals with the mouse, a failure
to save our registry stuff (because we were calling exit() instead
of doing a PostQuitMessage()), and a misclassification of triangles
coplanar with the test surface, when the test surface contained
zero-area triangles.

[git-p4: depot-paths = "//depot/solvespace/": change = 1773]
2008-06-03 10:48:47 -08:00
Jonathan Westhues ea6db67c7d Improve convergence of constraints involving parallel vectors, by
using the initial numerical guess of whichever vector is already
known to choose our projection planes.

And add a mechanism to defer showing the text window or
regenerating, in order to simplify dependencies on valid actives.
Also yes/no/cancel when about to abandon an unsaved file, and a
bugfix when rotating a rot/trans point.

[git-p4: depot-paths = "//depot/solvespace/": change = 1772]
2008-06-03 10:28:41 -08:00
Jonathan Westhues 7d4a4fbb76 We now have selective solve; a group (and all the groups afterward)
becomes dirty when the user makes a change, and only the dirty
groups get solved. That's a huge effective speedup.

Also add delete function for groups. That has an interesting issue;
it actually ends up recursing on GenerateAll(), since GenerateAll()
calls ClearSuper(), ClearSuper() might need to recreate a group (if
all the groups were deleted), and that would activate the group,
which calls GenerateAll. The right solution is probably a deferred
execution mechanism, where you can schedule something to happen
before we go idle, but not do it right now.

[git-p4: depot-paths = "//depot/solvespace/": change = 1771]
2008-06-02 03:43:27 -08:00
Jonathan Westhues 236ee16da6 Consolidate the code that determines whether an entity is visible
in one place. And remove the ability to disable the solver, since
that's unlikely to be anything but confusing (and in any case, was
badly implemented). This is in preparation for selective solving,
of only the dirty groups.

[git-p4: depot-paths = "//depot/solvespace/": change = 1769]
2008-06-02 01:31:26 -08:00
Jonathan Westhues a084b32064 Stipple the selected/hovered faces, instead of drawing them in
solid red or yellow. And add user interface to `hide' the faces
(i.e., to make them unselectable), defaulting to hidden in
everything except extrudes or imports.

[git-p4: depot-paths = "//depot/solvespace/": change = 1768]
2008-06-01 21:38:12 -08:00
Jonathan Westhues 6748160026 Add selectable faces, by associating an hEntity with the triangle's
metadata. And add point-on-face constraints to go with that. Still
needs some cleanup for the user interface.

[git-p4: depot-paths = "//depot/solvespace/": change = 1766]
2008-06-01 19:31:37 -08:00
Jonathan Westhues 04af0944bc Standardize naming of FromXxx (and XxxFrom) static methods to
create a `new' stack-allocated instance of an object; just From,
possibly different versions with different arg types.

[git-p4: depot-paths = "//depot/solvespace/": change = 1763]
2008-06-01 00:45:11 -08:00
Jonathan Westhues 709b5ad80e Add an axis-angle transformation (rotation about an arbitrary
point), and use that to implement step and repeat rotating.

[git-p4: depot-paths = "//depot/solvespace/": change = 1762]
2008-06-01 00:29:59 -08:00
Jonathan Westhues 1d1bec83b1 Little tweaks: wider lines drawn, fix editing dimensions.
[git-p4: depot-paths = "//depot/solvespace/": change = 1761]
2008-05-31 20:31:28 -08:00
Jonathan Westhues 2cb4800fbf Start to describe the selected entities in the text window. Also
more starting work on the selectable faces, and fiddling in an
attempt to remove dependencies when stuff gets deleted.

[git-p4: depot-paths = "//depot/solvespace/": change = 1760]
2008-05-31 16:26:41 -08:00
Jonathan Westhues 3c9084b240 Remove stupid "show any datum" link, and replace with a link to
show/hide the mesh (drawn as wireframe triangles).

[git-p4: depot-paths = "//depot/solvespace/": change = 1754]
2008-05-28 02:34:55 -08:00
Jonathan Westhues 502211495b Add the file open/save user interface. This includes a list of
recently opened files, that is saved in the registry and displayed
in a separate popup menu.

[git-p4: depot-paths = "//depot/solvespace/": change = 1752]
2008-05-28 02:10:31 -08:00
Jonathan Westhues 4375c01c51 Add step and repeat translate, with multiple copies; that all works
nicely. And to do that, I've added the user interface to show an
edit control in the text window.

[git-p4: depot-paths = "//depot/solvespace/": change = 1749]
2008-05-26 22:36:59 -08:00
Jonathan Westhues ecee90965e Change the workplanes a bit. Now the active workplane is per group,
so e.g. a new extrude starts in free space, which is likely what
you want. And default to an in-workplane group, and tweak the
display of workplanes.

[git-p4: depot-paths = "//depot/solvespace/": change = 1748]
2008-05-26 18:22:20 -08:00
Jonathan Westhues b484c26493 Many user interface additions. Now I report when the solver fails,
and in the case of a singular Jacobian, report which constraints
can be removed to fix it. Also a mechanism to hover and select
entities and constraints from the text window.

[git-p4: depot-paths = "//depot/solvespace/": change = 1746]
2008-05-26 01:56:50 -08:00