Commit Graph

  • 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. Jonathan Westhues 2009-09-29 03:35:19 -0800
  • 9f78ee3c33 Treat delete, backspace, and browser back all identically. Jonathan Westhues 2009-09-28 02:01:34 -0800
  • bdf60690c1 Replace copyright notices for SolveSpace with my LLC, not my name. Jonathan Westhues 2009-09-28 01:48:56 -0800
  • a887039707 Show info when a Constraint::COMMENT is selected, so that the user can apply a style that way too; and apply the export scale factor to the line width. Jonathan Westhues 2009-09-24 08:04:46 -0800
  • 4634961054 Add ability to assign styles to cosmetic text (in the form of Constraint::COMMENTs), including line width and color, and text height and origin location. Jonathan Westhues 2009-09-24 07:52:48 -0800
  • 9416faca88 Add a context menu, with a grab bag of options. That will need some refinement later, but it does not affect file formats so it's not very critical. Jonathan Westhues 2009-09-23 02:59:59 -0800
  • 274005c02c Make hidden line removal keep all the line styles, and don't apply that to the constraints. Jonathan Westhues 2009-09-21 22:47:11 -0800
  • 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. Jonathan Westhues 2009-09-21 21:46:30 -0800
  • 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. Jonathan Westhues 2009-09-18 00:14:15 -0800
  • 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. Jonathan Westhues 2009-09-16 23:32:36 -0800
  • 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. Jonathan Westhues 2009-09-03 00:13:09 -0800
  • f7f9000c68 Discard intersection curves that lie entirely outside of one surface's domain of u, v in [0, 1]. Cache the starting guess when projecting a point into a ratpoly surface, to avoid brute force searching for a good one every time. Split edges even if they aren't quite inside the trim curve, since the trim boundaries are pwl, not exact; unnecessary splits won't hurt, but failure to split when necessary will. Make the triangulation code use a better (but not perfect) epsilon, to avoid "can't find ear" failures on very fine meshes. Jonathan Westhues 2009-08-20 20:58:28 -0800
  • 36182448ce Oops, forgot to consider scale (pixels/mm) for translation from six-DOF mouse. Jonathan Westhues 2009-07-25 17:29:56 -0800
  • 806c3d8cde Decrease Z gain while transforming an imported part with the six-DOF mouse. That's normal to the screen, so it's otherwise easy to get a big movement without realizing (especially with a parallel projection of the part). Jonathan Westhues 2009-07-25 15:46:01 -0800
  • 606af2ff39 Add support for the 3dconnexion six degree of freedom input devices (in my case, a SpaceNavigator). I can transform the view of the part, or transform a part in an assembly. Jonathan Westhues 2009-07-20 11:05:33 -0800
  • 92da6c665b Change how step and repeat works: now I build the union of all the steps in thisShell or thisMesh, and then let the Boolean proceed as usual. If everything works, then this is equivalent. And it's less code, and it makes stuff like stepping the step and repeat work. Jonathan Westhues 2009-07-19 17:47:59 -0800
  • 8b7f45e72e That optimization where I display the previous group's mesh or shell when the current group has thisMesh and thisShell empty was broken, since rotate or step and repeat groups don't use those. Jonathan Westhues 2009-07-19 13:30:09 -0800
  • f45eb959f4 Split export.cpp; now exportvector.cpp has all the file format specific stuff. Jonathan Westhues 2009-07-08 01:44:13 -0800
  • 4c825a803a When deleting a request, rewrite the constraints on its points in such a way as to keep all the points that used to be coincident, still coincident. Jonathan Westhues 2009-07-08 01:36:18 -0800
  • 1692382d5a Replace the closed-form solutions for entity-entity splitting with a method that works on the piecewise linear segments, and then refines any intersections that it finds by Newton's method. So now I support cubics too, and circle-circle intersections, and the code is much simpler. Jonathan Westhues 2009-07-07 00:21:59 -0800
  • 66c93aab73 Add a mechanism to record the lines drawn when we display a constraint, so that we can export that too. This includes the lines for the vector font. Jonathan Westhues 2009-07-03 12:55:57 -0800
  • a74f85e0d1 I had been using LENGTH_EPS as the tolerance on both xyz points and uv points. This is inconsistent, unless the surface happens to be a plane square with side length one. Jonathan Westhues 2009-07-01 19:32:17 -0800
  • 3f5c439873 A very important optimisation; if we know that our mesh/shell is identical to the previous group's (because our thisShell and thisMesh are empty), then display the previous group's instead. This saves us re-triangulating the shell (or recalculating the edges of a triangle mesh) every time our group gets regenerated, which was horribly slow. Jonathan Westhues 2009-06-29 23:24:36 -0800
  • 4ca7548ffe Don't merge two coincident surfaces unless they share an edge. Otherwise, we might merge in ways that make things slower (because the bboxes aren't as tight) or less robust (because the intersection needs to be split in more places, and that might fail). Jonathan Westhues 2009-06-29 20:38:40 -0800
  • f865901bd2 Group edges into chains (that don't intersect edges from the other contour, except at the ends of the chain), and classify the entire chain. That's much faster than going edge by edge. Jonathan Westhues 2009-06-26 21:53:56 -0800
  • cf77e51ddc I think this fixes an issue importing STEP into Rhino. Something bad seems to happen when a trim curve's u or v coordinate goes even slightly outside [0, 1]. And since I considered the bbox of the pwl segments when merging coincident surfaces (and not the true curves), that happened. So add a bit of slop, which seems to make things happy. Jonathan Westhues 2009-06-25 03:58:39 -0800
  • 3da334028e Let's use the direction cosines (dot product of unit vectors), not the arbitrary-magnitude dot product, to classify regions (inside, outside, coincident) of surfaces against each other. Jonathan Westhues 2009-06-21 22:22:30 -0800
  • bd36221219 Clean up the marching step size / chord tol stuff, and add code to export an inexact curve by approximating it with piecwise cubic segments (whose endpoints lie exactly on the curve, and with exact tangent directions at the endpoints). Jonathan Westhues 2009-06-21 18:54:09 -0800
  • 684ba7deb1 Add a menu item to rotate an imported part by ninety degrees about the coordinate axis closest to the screen normal. Jonathan Westhues 2009-06-21 12:39:42 -0800
  • c6a0148724 When splitting a curve against surfaces, don't split the curve against the surfaces that it supposedly borders; that will cause numerical trouble. Jonathan Westhues 2009-06-21 01:54:21 -0800
  • 4c8f535305 Split line-surface intersection and shell raycasting stuff into its own file. Jonathan Westhues 2009-06-21 01:14:49 -0800
  • d3dcd8fb23 Now we are actually marching. There seems to be either a numerical problem or a tendency to generate backwards edges or both, need to debug that. But it generates the curve, and begins to work. Jonathan Westhues 2009-06-21 01:02:36 -0800
  • 666ea1c047 Add beginnings of marching surface intersection; I can find all the boundary points, at least. That required some changes to what gets passed around (for example because to project a point onto this inexact curve, we need to know which two surfaces it trims so that we can do a Newton's method on them). Jonathan Westhues 2009-06-18 23:56:33 -0800
  • 314227ead7 Don't count point-coincident constraints towards the limit (when the software is unlicensed), and change the limit to 25. Jonathan Westhues 2009-06-14 14:17:03 -0800
  • 7eefb79127 Show a progress message when regenerating is slow. And update the version number to 1.4, don't include force-hidden entities when building the loops, and don't show force-hidden entities when that entity gets copied. Jonathan Westhues 2009-06-13 20:36:38 -0800
  • 3b3b7fe680 Add STEP file export for 2d curves too, and disable extrusion not normal to the sketch. Jonathan Westhues 2009-06-10 21:57:23 -0800
  • 19fbae5b66 Oops, don't let the coincident surface merging stuff try to merge empty (no trims) surfaces. It will generate a screwy bounding box, which will make things break numerically later. Jonathan Westhues 2009-06-10 00:26:09 -0800
  • 2013f9f466 Oops, was computing numerical by perturbing a point in uv; but the xyz point that I subtracted off had been refined to lie exactly on our edge's curve, and the uv point that I started with had not. So normals got randomly screwed up. Jonathan Westhues 2009-06-10 00:04:35 -0800
  • 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. Jonathan Westhues 2009-06-09 22:57:27 -0800
  • ee6939a761 Output rational b-spline curves and surfaces in the STEP file, and make sure that our edge loops are exactly (considering only the vertex id) closed. Jonathan Westhues 2009-06-08 18:04:15 -0800
  • 603f47692e When exporting STEP, identify the outer contours, and group them and their holes into their own advanced faces. So a single surface with multiple outer contours generates multiple advanced faces. Jonathan Westhues 2009-06-08 08:21:33 -0800
  • 9455037e49 Add beginnings of STEP export, which weren't as horrible as I had feared. Though I don't have rational surfaces or curves going yet, and I don't have the stuff to handle holes or multiple outer contours in a single surface. Jonathan Westhues 2009-06-07 22:50:16 -0800
  • 3e86050685 Report the number of triangles and surfaces in the naked edges check, hide the coordinate axes at the origin when normals are hidden (but still show the coordinate axes at the bottom left of the screen), and report point-line distance when a point and a line are selected. Jonathan Westhues 2009-06-07 15:00:57 -0800
  • 7a279c4e3f Fix interference check to not report not-2-manifold edges; those can occur in assemblies with coincident faces. And turn on smooth shading, finally. Jonathan Westhues 2009-06-06 01:44:58 -0800
  • 213c21db87 Oops, was looking for edges on the display mesh that I generated from the NURBS surface! That got very slow very fast. Jonathan Westhues 2009-06-06 01:19:25 -0800
  • 2f7a6bb61d Don't merge coincident surfaces when combining two shells as "assemble". And don't show "naked" (not occuring in anti-parallel pairs) edges when just testing for interference. Jonathan Westhues 2009-06-06 00:21:03 -0800
  • 2d653eada8 Add code to identify planes and cylindrical surfaces from a solid of revolution, and put them in the same form as if they had been draw by an extrusion (so that we can use all the same special case intersection curves). Jonathan Westhues 2009-06-04 21:38:41 -0800
  • ae35b3595c Revamp the edge classification for Booleans. I no longer make a separate polygon of coincident (with same or opposite normal) faces; I instead test all the edges against the other shell, and have extended the classify-against-shell stuff to handle those cases. Jonathan Westhues 2009-06-03 19:59:40 -0800
  • 24891c0141 Fix a couple of issues with SolveSpace as a library; was using the wrong parameters for a normal in Example2d(), and the horiz/vert constraints were not documented correctly. Jonathan Westhues 2009-06-01 19:17:18 -0800
  • 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. Jonathan Westhues 2009-05-30 00:49:09 -0800
  • 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. Jonathan Westhues 2009-05-28 21:40:17 -0800
  • 7536ccb054 Put back the "snap to vertex" stuff to remove tee intersections that the BSP-based Booleans create. Jonathan Westhues 2009-05-27 23:07:54 -0800
  • 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. Jonathan Westhues 2009-05-24 03:37:07 -0800
  • 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). Jonathan Westhues 2009-05-22 02:02:02 -0800
  • 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. Jonathan Westhues 2009-05-21 01:06:26 -0800
  • e70bb37061 Fix bug in hidden line removal when an edge, projected into the xy plane, lies exactly on the boundary of a triangle. Jonathan Westhues 2009-05-20 05:07:56 -0800
  • b4dfb1aded Add code to assemble two shells into one, without checking for any intersections or otherwise trying to make the result not self-intersecting. Jonathan Westhues 2009-05-19 19:04:36 -0800
  • bc6bdfade8 Save the exact surfaces in the exported file, and import and transform them for assembly. Jonathan Westhues 2009-05-18 23:26:38 -0800
  • 1d88f96e13 Make surfaces of revolution with control points on the axis triangulate correctly; don't screw up generating them, and make sure that the ratpoly stuff doesn't blow up near the singularity. Jonathan Westhues 2009-05-18 00:18:32 -0800
  • 40ed1b7ac1 Generate intersection curves for surfaces of extrusion along a parallel axis (which are always lines parallel to that axis). Jonathan Westhues 2009-05-17 23:26:51 -0800
  • d6d198ee40 Add triangulation of surfaces with compound curvature; I just build a grid of quads, with adaptive spacing. The quads that lie entirely within the trim polygon are triangulated and knocked out from the polygon, and then the polygon is triangulated. Jonathan Westhues 2009-05-08 00:33:04 -0800
  • 3581d9b9ec Construct surfaces of revolution from lathe groups, although we're not triangulating them correctly yet. Jonathan Westhues 2009-04-28 18:42:44 -0800
  • ff6eae884e Oops, forgot to clear out the equations (and the entities, though I don't use them) in the System. Jonathan Westhues 2009-04-24 17:27:45 -0800
  • f8dbc89189 Polish a few little things in the constraint solver library stuff. Jonathan Westhues 2009-04-21 22:15:01 -0800
  • 9efa922795 Add a solver option to not calculate the failing constraints if we're inconsistent (singular Jacobian). That's slow, so we should provide a library interface to disable it. Jonathan Westhues 2009-04-20 23:56:17 -0800
  • 1554402b30 Oops, forgot slvs.h. Jonathan Westhues 2009-04-19 23:32:07 -0800
  • 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. Jonathan Westhues 2009-04-19 23:30:09 -0800
  • 11e4c7f5d9 Oops, don't just crash when the MAX_UNKNOWNS limit is exceeded. Jonathan Westhues 2009-04-19 12:37:51 -0800
  • 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. Jonathan Westhues 2009-04-18 21:53:16 -0800
  • b293c0ef41 Split the Entity and Constraint classes into Xxx and XxxBase, with the fundamental geometric stuff in XxxBase. Next I hope to make the constraint solver use only the XxxBase types. Jonathan Westhues 2009-04-18 20:28:21 -0800
  • bab13b821f Little optimizations in the solver; don't write the Jacobian redundantly, more zero partial avoidance, slight speedup to linear system solve. Jonathan Westhues 2009-04-18 19:55:46 -0800
  • 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. Jonathan Westhues 2009-04-15 20:42:51 -0800
  • 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. Jonathan Westhues 2009-04-14 22:50:06 -0800
  • b5c8aade21 Add exact export of arcs for EPS, DXF, SVG, and of nonrational polynomial curves for SVG. Jonathan Westhues 2009-04-14 18:55:18 -0800
  • 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. Jonathan Westhues 2009-04-13 20:19:23 -0800
  • 22afc5ea15 The hidden line removal unnecessarily splits our edges, which bloats the output file size. So reassemble the edges whenever possible. Jonathan Westhues 2009-04-07 20:54:07 -0800
  • 71adc0bf54 Split ratpoly.cpp; now that contains only the mathematical stuff, and curve.cpp and surface.cpp contain the rest. Jonathan Westhues 2009-03-28 22:05:28 -0800
  • 7f3dd91bd9 Add a special case for line-cylinder intersection, solving in closed form. This is a fairly good speedup, and handles tangency well. Jonathan Westhues 2009-03-19 09:40:11 -0800
  • 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. Jonathan Westhues 2009-03-17 20:26:04 -0800
  • 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). Jonathan Westhues 2009-03-17 08:33:46 -0800
  • ed9f448398 Oops, need to remap plane face entities when stepping and repeating shells. Jonathan Westhues 2009-03-15 21:11:06 -0800
  • acadc0a918 Many changes: Jonathan Westhues 2009-03-15 15:04:45 -0800
  • 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. Jonathan Westhues 2009-03-14 12:01:20 -0800
  • 8c648af4de Fix bug with text window, where it scrolled up of its own intiative when resized. Jonathan Westhues 2009-03-11 04:22:32 -0800
  • bc70089dd0 Add code to subdivide (with de Castljau's algorithm) a surface, and use that for surface-line intersections. That has major problems with the heuristic on when to stop and do Newton polishing. Jonathan Westhues 2009-03-08 02:59:57 -0800
  • c128018c55 Remove idiotic tolerance in Point2d::WithMagnitude(). What was I thinking? Jonathan Westhues 2009-03-01 21:52:08 -0800
  • 77cace05ce When clipping ears to triangulate a curved surface, clip the ear that minimizes the chord tolerance. Jonathan Westhues 2009-02-27 06:05:08 -0800
  • 2023667311 Add Newton iterations to intersect a line with a surface at a point, and to intersect three surfaces at a point. So now when we split an edge, we can refine the split point to lie exactly on the trim curve, so I can do certain Booleans on curved surfaces. Jonathan Westhues 2009-02-27 05:04:36 -0800
  • 3da1e1d390 Compute surface intersections in a way that is closer to what I will do for real; now handling the special cases of plane against a surface of extrusion. Still need to fix up line-surface intersection to work for curved things, but then some simple curved cases should work (as well as plane-plane). Jonathan Westhues 2009-02-23 02:06:02 -0800
  • 9ade574d36 Fix triangulation issues when a polygon has more than two edges at a vertex. Jonathan Westhues 2009-02-18 03:15:33 -0800
  • 577cdf2255 More coincident fixing; test for edge-on-edge, fix some gross stupidity. Jonathan Westhues 2009-02-17 03:17:12 -0800
  • c6b429b9ce Additional poking at Booleans. At least this is a halfway rational way to think about the cases; I'm classifying the regions to the left and right of each edge, and keeping the edges if those regions (2d, surfaces) classify different. Jonathan Westhues 2009-02-16 04:05:08 -0800
  • 90842131ff Make Boolean union work when the shells have coincident plane faces. Still on planes only, no curved surface intersections. Jonathan Westhues 2009-02-09 04:40:48 -0800
  • d0ab8270d9 Fix stupidity in Point2d::DistanceToLine, and classify line segments in Boolean against the shell, not the intersection polygon. (We just cast a ray, and use the surface-line intersection function that already existed.) That's slow, but can be accelerated later. Jonathan Westhues 2009-02-01 05:01:28 -0800
  • 9ffe95ea65 More work on Booleans. This works only for planes, and only for non-coincident faces. There's also a problem when I don't generate the full intersection polygon of shell B against a given surface in shell A; I need to modify the code to not require that. Jonathan Westhues 2009-01-31 21:13:43 -0800
  • db8859ec31 Test for self-intersecting mesh too when we test for naked edges. Jonathan Westhues 2009-01-27 23:09:01 -0800
  • 715a554637 So that's why projection into the surface kept failing; was using the magnitude of the wrong derivative! Fix that, good. Jonathan Westhues 2009-01-27 01:22:18 -0800
  • a754018a44 More poking at Booleans; generate the unsplit intersection curves for planes against planes. Jonathan Westhues 2009-01-26 23:59:58 -0800
  • 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. Jonathan Westhues 2009-01-26 21:48:40 -0800
  • 07ddd62a3a Preparatory work for Boolean. Make the u and v coordinates of the trim curves for all surfaces lie between 0 and 1. And add routines to merge the curves and surfaces from two shells into one, and to split the trim curves into their piecewise linear segments and then reassemble them into trim curves. Jonathan Westhues 2009-01-25 03:52:29 -0800