Commit Graph

52 Commits (a95054890f6265e7809aa12e6f5930fbdfbf7302)

Author SHA1 Message Date
Jonathan Westhues 9f7ff34b98 Add option to treat all dimensions as reference dimensions. This is
useful because it makes it possible to add cosmetic dimensions to
an existing model, without REF appended.

[git-p4: depot-paths = "//depot/solvespace/": change = 2140]
2010-05-09 17:06:09 -08:00
Jonathan Westhues 8481c54012 Major UI changes, to use the checkboxes and radio buttons wherever
possible. This replaces all of the color-coded links, that I liked
but that were nonstandard.

Also rip out the old sweep and helical sweep UI; that was disabled,
but the code was still present.

And fix dependencies in makefile, since textwin.cpp depends on the
icons now.

[git-p4: depot-paths = "//depot/solvespace/": change = 2139]
2010-05-09 10:25:23 -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 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 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 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 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 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 2e9e0da71f Add ability to relax the constraints, applying only
point-coincident constraints and the entity- or group-generated
constraints. Also fix a bug where a dragged point was not released
when the mouse pointer left the window.

[git-p4: depot-paths = "//depot/solvespace/": change = 2045]
2009-10-01 03:22:56 -08:00
Jonathan Westhues 33dfff2a78 Add option to disable the "not closed contour" warnings and such,
instead of tying that to whether the shaded model is shown. And
rewrite all URLs to solvespace.com, not www.solvespace.com, and get
rid of the nag screen that I just added because opening the website
with ShellExecute seems to freeze a bit on startup.

[git-p4: depot-paths = "//depot/solvespace/": change = 2044]
2009-10-01 02:35:11 -08:00
Jonathan Westhues 35df6bd06a Split draw.cpp and textscreens.cpp, and move a few things around.
This creates mouse.cpp and confscreen.cpp.

[git-p4: depot-paths = "//depot/solvespace/": change = 2040]
2009-09-29 05:14:47 -08:00
Jonathan Westhues db565438e3 Add text angle for styles. Add ability to quickly change between
perspective and parallel projections. Add a snap grid, for points
and for text comments. Draw text comments in the plane of their
workplane if they have one, otherwise always facing forward.

And fix a few nasty bugs: the possibility of an extremely long
animation onto a workplane, accidental use of the wrong style line
width for constraints, misplaced text box in style screen for
default styles, other little stuff.

[git-p4: depot-paths = "//depot/solvespace/": change = 2037]
2009-09-29 03:35:19 -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 517c5edbfa Add user interface to modify styles: change the color, line width,
line width units, on-screen and export visibility. So now we can
use that to modify the default styles, or to create custom styles.

Also add code to draw fat lines, with round endcaps, since gl
doesn't do that.

Next we need some user interface to assign styles to entities, and
to make all the export file formats support the style attributes.

[git-p4: depot-paths = "//depot/solvespace/": change = 2029]
2009-09-18 00:14:15 -08:00
Jonathan Westhues ce99217bbb Move colors and line widths for almost everything to the styles
mechanism. This gets filled in from some defaults, and stored in
the registry. The default styles do not get saved in the file, but
user-created styles (which aren't supported yet) do.

[git-p4: depot-paths = "//depot/solvespace/": change = 2028]
2009-09-16 23:32:36 -08:00
Jonathan Westhues e989c86a38 Add ability to set export canvas size (paper size for PDF, bbox
size for EPS, etc.). This can either be fixed, with a given width
and height and offset, or automatic, by the left right bottom top
margins.

And draw nicer dimensions for length, with arrows and more
extension lines. Add code to trim those lines against the
(rectangular, axis-aligned) box that contains the actual number,
and use that (instead of the elliptical interpolation, which was
only approximately right) for diameter dimensions too.

[git-p4: depot-paths = "//depot/solvespace/": change = 2027]
2009-09-03 00:13:09 -08:00
Jonathan Westhues 1ac083a9a2 Change the licensing so that we run unrestricted for ninety days
after first execution, but limit the number of constraints to 30
after 90 days.

[git-p4: depot-paths = "//depot/solvespace/": change = 1977]
2009-06-09 22:57:27 -08:00
Jonathan Westhues 438d517c5a If a Boolean fails, then make a note of it in the group's text
window screen, and remind the user that they could 'fix' the
problem by working with meshes instead.

[git-p4: depot-paths = "//depot/solvespace/": change = 1962]
2009-05-30 00:49:09 -08:00
Jonathan Westhues ddbd0ff77b Add ability to represent our surfaces as either a shell or a mesh,
according to the user's preference. I templated the housekeeping
stuff for Boolean operations and step and repeat, so it's
relatively clean.

Still need to add the stuff to make a mesh vertex-to-vertex, and to
export sections of a mesh.

[git-p4: depot-paths = "//depot/solvespace/": change = 1959]
2009-05-24 03:37:07 -08:00
Jonathan Westhues 03ecbad981 Add beginnings of stuff to represent surfaces as either meshes or
exact surface shells. And add interference checking; I'll be lazy
and just do that on the meshes, by modifying the self-intersection
tester to ignore coplanar triangles (since that can happen in an
assembly).

[git-p4: depot-paths = "//depot/solvespace/": change = 1958]
2009-05-22 02:02:02 -08:00
Jonathan Westhues ddf9364257 Add a separate display mesh and edge list; so if we're working with
a mesh than that's a copy, and if we're working with a shell then
it's the shell's triangulation.

[git-p4: depot-paths = "//depot/solvespace/": change = 1957]
2009-05-21 01:06:26 -08:00
Jonathan Westhues 4d742a5777 The constraint solver now compiles as a library, and I have a
little test app that links against it. I still need to polish a few
things, but this is more or less as it should be.

[git-p4: depot-paths = "//depot/solvespace/": change = 1944]
2009-04-19 23:30:09 -08:00
Jonathan Westhues 11e4c7f5d9 Oops, don't just crash when the MAX_UNKNOWNS limit is exceeded.
[git-p4: depot-paths = "//depot/solvespace/": change = 1943]
2009-04-19 12:37:51 -08:00
Jonathan Westhues a4dc518a89 A monster change; move the parameter, entity, group, and constraint
tables from SolveSpace to their own class. This is intended to
simplify use of the constraint solver in a library.

[git-p4: depot-paths = "//depot/solvespace/": change = 1942]
2009-04-18 21:53:16 -08:00
Jonathan Westhues 16de9a485a Oops, don't export construction lines. And we can't do exact curves
with cutter radius offset, and 2 pixels is a better default chord 
tolerance than 1.

[git-p4: depot-paths = "//depot/solvespace/": change = 1939]
2009-04-15 20:42:51 -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
Jonathan Westhues d4b842a242 Generate additional edges wherever a front- and back-facing
triangle join. And add controls to show and hide the solid model
edges (independently of the shaded mesh), and to suppress the
shaded triangles from SVG/EPS output.

[git-p4: depot-paths = "//depot/solvespace/": change = 1932]
2009-03-17 20:26:04 -08:00
Jonathan Westhues adc910185c Add plane-plane intersection as a special case (to generate the
trimmed line), and plane-line intersection. Terminate the Bezier
surface subdivision on a chord tolerance, and that seems okay now.
And print info about the graphics adapter in the text window, could
be useful.

Also have a cylinder-detection routine that works; should special
case those surfaces in closed form since they are common, but not
doing it yet.

[git-p4: depot-paths = "//depot/solvespace/": change = 1928]
2009-03-14 12:01:20 -08:00
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 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 92f55dd195 Speed up the inconsistent constraint detection; there's no reason
not to solve by substitution before rank testing. And report the
unsatisfied constraints when we don't converge.

[git-p4: depot-paths = "//depot/solvespace/": change = 1874]
2008-09-05 03:25:53 -08:00
Jonathan Westhues 25aa1826ee Change wording for not licensed message.
[git-p4: depot-paths = "//depot/solvespace/": change = 1871]
2008-08-21 01:47:03 -08:00
Jonathan Westhues 962cb1af4a Add cutter radius compensation. That's a bolt on thing at the end;
just applies an offset to the DXF before exporting. Useful enough
to be worth the ugliness, though.

This is the stupid routines from SketchFlat, slightly reworked.

[git-p4: depot-paths = "//depot/solvespace/": change = 1866]
2008-08-14 00:28:25 -08:00
Jonathan Westhues 96f5663d6e Add a configuration option to hide the back faces; that gets rid of
stray red pixels sometimes, if the mesh is leaky or the graphics
card isn't perfect.

[git-p4: depot-paths = "//depot/solvespace/": change = 1864]
2008-08-11 02:56:08 -08:00
Jonathan Westhues bd0e97bad0 Now I can suppress an imported part; so the entities still show up,
but the mesh doesn't get combined. That effectively hides it, good
for looking inside and such.

[git-p4: depot-paths = "//depot/solvespace/": change = 1860]
2008-02-15 03:35:15 -08:00
Jonathan Westhues dae5cdf9b8 Change name to SolveSpace everywhere.
[git-p4: depot-paths = "//depot/solvespace/": change = 1858]
2008-02-13 08:13:08 -08:00
Jonathan Westhues c42033d123 Add a configuration item to specify the maximum number of piecewise
linear segments to generate, irrespective of the chord tolerance.
That used to be hard-coded, and it needs to be small enough to
avoid lags while working interactively, but I also need to export
fine geometry.

[git-p4: depot-paths = "//depot/solvespace/": change = 1857]
2008-02-12 05:00:26 -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 7b7d2f92e9 Add code to evaluate the volume of a mesh, thanks to the divergence
theorem; it's evaluated as a surface integral over each triangle.

And don't regenerate the emphasized edges unless we have to;
specifically, don't do it when the only dirty group is the
drawing group.

[git-p4: depot-paths = "//depot/solvespace/": change = 1849]
2008-02-07 01:53:52 -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 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 44795175ee A suggestion when we fail to converge or go singular.
[git-p4: depot-paths = "//depot/solvespace/": change = 1832]
2008-07-09 23:17:35 -08:00
Jonathan Westhues 49b6e9a74d Remove the back button from the text window, since I never used it.
And fix a bug; wasn't asking the user whether to save before
abandoning file when a new file was opened recent.

[git-p4: depot-paths = "//depot/solvespace/": change = 1830]
2008-07-09 22:11:56 -08:00
Jonathan Westhues 7622534b2a Make the piecewise linear stuff for cubics and quadratics adaptive,
based on a chord tolerance. And rewrite the pwl circles to work
against a chord tolerance too (which they really were doing before,
but in funny units).

Also make "assemble" combine type do a union after interference
checking; was previously just copying, which meant that coplanar
faces could break subsequent operations.

And make right-clicking effectively toggle shift key, instead of
forcing it on; so you can pan or rotate with either right or middle
button.

[git-p4: depot-paths = "//depot/solvespace/": change = 1829]
2008-07-09 21:26:08 -08:00
Jonathan Westhues dd23aa11a2 Make rotations default to 360/n degrees (uniform about a circle)
if no constraints set the rotation.

[git-p4: depot-paths = "//depot/solvespace/": change = 1827]
2008-07-08 22:13:49 -08:00
Jonathan Westhues 72d188619d Add a scale factor when exporting; the user specifies a number, and
all coordinates are divided by that number as we export.

And add functions to store a float in the registry. I'm using those
for the scale factor, and also to replace the crazy scaled integers
that I was using for light positions etc. before.

[git-p4: depot-paths = "//depot/solvespace/": change = 1824]
2008-07-07 23:41:29 -08:00
Jonathan Westhues cad77c9c47 Add routines to remove T intersections from the mesh, which are
introduced by the bsp routines. It's usually, though not always,
possible to generate a watertight mesh. The occasions where it's
not look ugly, floating point issues, no quick fix.

And use those to generate a list of edges where two different faces
meet, which I can emphasize for cosmetic reasons (and some UI to
specify whether to do that, and with what color).

And make the right mouse button rotate the model, since that was
previously doing nothing.

[git-p4: depot-paths = "//depot/solvespace/": change = 1821]
2008-07-05 23:56:24 -08:00
Jonathan Westhues 48c5018613 Add symmetric about line constraint. This applies only when locked
in a workplane, since it would otherwise be ambiguous.

[git-p4: depot-paths = "//depot/solvespace/": change = 1817]
2008-07-01 22:59:49 -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