Commit Graph

34 Commits (715a554637fa8b136e251a793d46485b27a84a5d)

Author SHA1 Message Date
Jonathan Westhues a754018a44 More poking at Booleans; generate the unsplit intersection curves
for planes against planes.

[git-p4: depot-paths = "//depot/solvespace/": change = 1907]
2009-01-26 23:59:58 -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 ebca6130ec Early attempts at rational polynomial surfaces. I can create one
from an extrusion, with piecewise linear trim curves for everything
(that are shared, so that they appear only once for the two
surfaces that each trims). No Boolean operations on them, and the
triangulation is bad, because gl seems to merge collinear edges.

So before going further, I seem to need my own triangulation code.
I have not had great luck in the past, but I can't live without it
now.

[git-p4: depot-paths = "//depot/solvespace/": change = 1899]
2009-01-19 02:37:10 -08:00
Jonathan Westhues f904c0fbee Entities now generate rational polynomial curves instead of
piecwise linear segments. These are piecewise linear approximated
for display, and currently for the mesh too, but that's the first
step to replace the mesh with exact curved surfaces.

[git-p4: depot-paths = "//depot/solvespace/": change = 1895]
2009-01-14 19:55:42 -08:00
Jonathan Westhues bf4de993cb Split constraint.cpp into two files: one for building the
constraint structures based on user input, and one for generating
equations from the constraints.

[git-p4: depot-paths = "//depot/solvespace/": change = 1885]
2009-01-03 04:31:19 -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 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 a783f14eff Add an icon file (ugly, but at least it's not the default anymore).
And add the manifest that gets us visual styles on the controls
under Win32.

[git-p4: depot-paths = "//depot/solvespace/": change = 1844]
2008-07-18 01:50:52 -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
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 bc5b43de85 Split the BSP stuff off the mesh stuff, and the text screens
themselves of the text window utility functions.

[git-p4: depot-paths = "//depot/solvespace/": change = 1806]
2008-06-23 00:37:12 -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 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 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 7c4d305895 Add polygon triangulation, by cheating. I'm using the gl tesselator
for that, and storing the triangles instead of rendering them
immediately. Not sure if that's smart; in theory could change from
implementation to implementation, but the results look much better
than I would get myself.

[git-p4: depot-paths = "//depot/solvespace/": change = 1733]
2008-05-22 02:28:28 -08:00
Jonathan Westhues 3cdbbb83b1 If a deletion makes it impossible to define other elements of the
sketch (e.g., a line whose length is constrained gets deleted, but
the constraint is left behind; or the point that's the origin for a
drawing group in plane gets deleted), then deleted the dependencies
too.

[git-p4: depot-paths = "//depot/solvespace/": change = 1725]
2008-05-16 22:04:55 -08:00
Jonathan Westhues a7cec38656 Add code to assemble the piecewise linear segments in a group into
a polygon, and to fill that polygon.

[git-p4: depot-paths = "//depot/solvespace/": change = 1686]
2008-04-24 23:04:09 -08:00
Jonathan Westhues 1331457928 Rough file/save for SolveSpace; that's all done from a single
table, relatively small code size. No user interface for it,
though.

[git-p4: depot-paths = "//depot/solvespace/": change = 1685]
2008-04-23 22:22:16 -08:00
Jonathan Westhues b78b10ac1a Ultra-rough beginnings of a solver. Write the constraint equations,
take the partial derivatives, and run the Newton's method. This
seems to sort of work with a single distance constraint.

[git-p4: depot-paths = "//depot/solvespace/": change = 1675]
2008-04-20 03:35:10 -08:00
Jonathan Westhues 0d3217c0df Rename some stuff in the IdList again. Rough in the file save
stuff, though no file load stuff, and perhaps this can all be made
to work from a table somehow. Move the quaternion stuff into its
own class, and add a fancy animated view when you orient onto a
csys.

[git-p4: depot-paths = "//depot/solvespace/": change = 1672]
2008-04-18 03:11:48 -08:00
Jonathan Westhues 1fa7865024 Add a little parser, that takes a string and generates and Expr *
syntax tree. That's what I'll used for entered dimensions, and
algebraic constraints and such. Needs to be extended to handle
stuff like points and entities, but I think that it can be.

[git-p4: depot-paths = "//depot/solvespace/": change = 1669]
2008-04-16 22:42:32 -08:00
Jonathan Westhues 22302dca7a Now I can add a constraint (a length), and it's displayed
on-screen, and I can drag the label. That's progress. Also
implement a bunch of untested expression stuff, since I'll need
that for the values of the dimensions, for example.

[git-p4: depot-paths = "//depot/solvespace/": change = 1668]
2008-04-14 02:28:32 -08:00
Jonathan Westhues 094e10204d Make the points locked in 2d csys (expressed as two parameters, for
the plane basis vectors) work, easy. Tweak the text window a bit,
for cosmetics, and start to add the symbolic expression code.

[git-p4: depot-paths = "//depot/solvespace/": change = 1667]
2008-04-13 06:28:35 -08:00
Jonathan Westhues b6bf07ac2c Rename cmdline.cpp to textwin.cpp, since it no longer has a command
line.

[git-p4: depot-paths = "//depot/solvespace/": change = 1666]
2008-04-13 02:58:22 -08:00
Jonathan Westhues 181e50f1d9 Add routines to draw a vector font (public domain Hershey Simplex
font, not bad). Use that to label the planes now.

[git-p4: depot-paths = "//depot/solvespace/": change = 1660]
2008-04-11 03:13:47 -08:00
Jonathan Westhues a7fa89c2cc Check in some SolveSpace stuff, even though I didn't make much
progress. I want to change the sketch.h stuff fairly significantly,
I think, before proceeding.

[git-p4: depot-paths = "//depot/solvespace/": change = 1657]
2008-04-08 04:54:53 -08:00
Jonathan Westhues 19c6be530f Bits and pieces of SolveSpace; zoom works now, and some stuff to
draw planes that I will use to do the datum planes. Still haven't
settled upon the request/entity/group structure, and that's the
dependency before doing much real.

[git-p4: depot-paths = "//depot/solvespace/": change = 1656]
2008-04-01 02:48:44 -08:00
Jonathan Westhues f201d52247 Add hyperlink and colour support to the text window. Don't redraw
the text window every time we refresh the graphics window, because
that's slow. Use classes instead of structs for everything; I don't
understand the template handling for structs. And implement the
IdList, which I will try to use in many places.

[git-p4: depot-paths = "//depot/solvespace/": change = 1655]
2008-03-28 02:00:37 -08:00
Jonathan Westhues e426fe8a53 Start to add OpenGL support to SolveSpace, for the graphical view.
I've got the user interface to pan and rotate an object, more or
less works.

[git-p4: depot-paths = "//depot/solvespace/": change = 1654]
2008-03-27 01:53:51 -08:00
Jonathan Westhues fcdf43d487 More fragments of SolveSpace work. Improve the command line window,
and add some (non-functional) menus to the graphics window. Start
to rough in some data structures to hold the sketch. No real work
yet, though.

[git-p4: depot-paths = "//depot/solvespace/": change = 1653]
2008-03-26 01:18:12 -08:00
Jonathan Westhues 67139236fc This is my initial checkin for solvespace, a second attempt at
constraint solver drawing. I've started work on the user inteface,
which will be based around two windows: one with the graphical
sketch, and one command line. I've started to implement the command
line, no other work.

[git-p4: depot-paths = "//depot/solvespace/": change = 1652]
2008-03-25 02:02:13 -08:00