Commit Graph

22 Commits (7a279c4e3f93a610fd1ff136b1cebfb5a7302542)

Author SHA1 Message Date
Jonathan Westhues 842645d61f Put back code to generate emphasized edges from a mesh; so now we
can show edges for both meshes and shells, and export them and
hidden line remove and all the usual stuff.

And fix the zoom to fit on startup, so that it considers hidden
entities too. That avoids the problem where things get generated at
stupid chord tolerance because no entities were visible and the
mesh of course did not yet exist.

[git-p4: depot-paths = "//depot/solvespace/": change = 1961]
2009-05-28 21:40:17 -08:00
Jonathan Westhues 7536ccb054 Put back the "snap to vertex" stuff to remove tee intersections
that the BSP-based Booleans create.

[git-p4: depot-paths = "//depot/solvespace/": change = 1960]
2009-05-27 23:07:54 -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 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 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 3ca2a6b80b Add direct PDF export. The only curves in PDF are nonrational
cubics, so add routines to approximate a rational Bezier of any
degree in that form. And use those for EPS and SVG when applicable,
so now even stuff like ellipses gets exported smooth.

[git-p4: depot-paths = "//depot/solvespace/": change = 1938]
2009-04-14 22:50:06 -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 22afc5ea15 The hidden line removal unnecessarily splits our edges, which
bloats the output file size. So reassemble the edges whenever
possible.

[git-p4: depot-paths = "//depot/solvespace/": change = 1935]
2009-04-07 20:54:07 -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 1a845c3432 Add hidden line and surface removal, and vector shaded surface
export. So I calculate lighting for each triangle in the mesh, make
a BSP, and then traverse it in-order and output those as SVG or
EPS. And I test edges against the mesh, removing those portions of
the edge that overlap a triangle in front of them (using the
kd-tree to accelerate).

[git-p4: depot-paths = "//depot/solvespace/": change = 1931]
2009-03-17 08:33:46 -08:00
Jonathan Westhues 95bded27ee Add eps, hpgl, and svg output (simple, all just for polylines). And
fix convergence tolerance so that points projected into a rational
polynomial surface end up much closer than LENGTH_EPS.

[git-p4: depot-paths = "//depot/solvespace/": change = 1906]
2009-01-26 21:48:40 -08:00
Jonathan Westhues 2e4ec6dd04 Add sin and cos to the expression entry (for dimensions etc.), with
the same precedence as sqrt. Add the code to find naked edges, and
draw them highlighted on the model. And make the direction of trim
curves consistent, always ccw with normal toward viewer; so there's
no need to fix the directions before triangulating.

[git-p4: depot-paths = "//depot/solvespace/": change = 1903]
2009-01-25 01:19:59 -08:00
Jonathan Westhues bb4b767e99 Tear everything apart, moving away from meshes and toward shells.
Add stubs for functions to perform Booleans, and get rid of mesh
stuff, including the kd tree accelerated snap to vertex (which
should not be required if the shell triangulation performs as it
should).

Also check that a sketch is not self-intersecting before extruding
it or whatever. This is dead slow, needs n*log(n) implementation.

[git-p4: depot-paths = "//depot/solvespace/": change = 1902]
2009-01-22 19:30:30 -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 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 22b78e4427 Assemble the group polygon ourselves when exporting a DXF; that
lets us export open curves, if the user drew them that way.

Also increase the limits on how many pwls we will generate for a
single curve.

[git-p4: depot-paths = "//depot/solvespace/": change = 1854]
2008-02-10 04:43:48 -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 115dbce61b Oops, wasn't closing the PNG file after exporting to it.
[git-p4: depot-paths = "//depot/solvespace/": change = 1848]
2008-07-20 17:34:09 -08:00
Jonathan Westhues 9136d86bff Split solvespace.cpp; leave the file menu and general-purpose stuff
where it was, move the export (DXF, PNG, STL) stuff to export.cpp,
and move the regen/solve stuff to generate.cpp.

[git-p4: depot-paths = "//depot/solvespace/": change = 1825]
2008-07-07 23:45:47 -08:00