Commit Graph

75 Commits (7f9117b2bf0636a594eb1f1ba76b9dbe0e8a4e83)

Author SHA1 Message Date
EvilSpirit 7f9117b2bf Calculate area of selected faces, if any. 2019-09-11 10:38:10 +00:00
EvilSpirit 915f55aabc Show volume of current group alongside total volume. 2019-09-11 10:38:10 +00:00
nabijaczleweli 837628ea3e Add VRML (WRL) triangle mesh export.
Transparency is not supported.
2019-08-09 21:30:33 +00:00
phkahler 986da7d224 Implement helical extrusion groups. 2019-07-31 04:16:56 +00:00
phkahler 5df53fc59e Implement revolve groups. 2019-06-03 17:32:38 +00:00
whitequark 6352405206 Deselect entities with Ctrl-LMB.
In other words, Ctrl inverts the normal action of LMB. It is already
possible to deselect entities through the context menu, but that
can be very awkward on laptop touchpads with a crowded sketch; with
Ctrl, a misclick is easily corrected without moving cursor at all.
2019-05-24 19:11:56 +00:00
whitequark 406c55e8b9 Instead of creating an exact copy of existing constraint, select it. 2019-05-24 16:21:55 +00:00
whitequark 549565958f Skip creating an automatic H/V constraint if it would be redundant.
This means that automatically added H/V constraints now will never
cause the sketch to become overconstrained, which currently makes
that feature almost unusable.
2019-05-24 15:06:53 +00:00
EvilSpirit 9d1c295495 Add a setting to format constraint labels using SI prefixes.
Supported metric units: km, m, cm, mm, µm, nm.
Supported USCS units: in, mil, µin.

Also, use the newly introduced unit formatting machinery in tools for
measuring perimeter, area and volume, so that e.g. volume is not
displayed in millions of cubic millimeters.
2019-05-24 12:31:41 +00:00
whitequark 50c004b679 Add a button to hide construction entities.
Also, mark not just curves, but also points and normals derived from
construction requests as construction.

Also, don't always mark arc center point as construction just to
exclude it from chord tolerance bounding box calculation; instead,
special-case it there.
2019-05-23 16:29:00 +00:00
Dynamo Dan e67f967933 Implement turntable (SketchUp-like) mouse navigation. 2019-05-23 15:45:15 +00:00
Bauke Conijn 7d181f0d0f Include custom styled entities in the same plane when exporting section. 2019-05-13 14:34:22 +00:00
whitequark bc3e09edbf GTK: use native file chooser dialog, if available.
This requires GTK 3.24+ and (at least for GTK 3.24) the environment
variable GTK_USE_PORTAL to be set to 1.
2019-05-08 22:59:20 +00:00
Sergiusz Bazanski 3a3a2755bf Implement Q3DO export.
We plan to use flatbuffers in the future for the next generation of
the .slvs file format, so flatbuffers are built unconditionally; and
the Q3DO exporter itself is tiny.
2019-03-28 08:53:37 +00:00
Bauke Conijn 8d07a6b4f4 Import missing styles from linked files. 2019-02-19 10:42:14 +00:00
Sergiusz Bazanski 9e512882d1 Add checkbox to control automatic line constraints
Signed-off-by: Sergiusz Bazanski <q3k@q3k.org>
2019-02-11 13:17:38 +00:00
whitequark 94b26ddfac Add a built-in Bitstream Vera Sans Roman font.
Before this commit, the default font chosen for TTF text is Arial
(chosen by the basename of arial.ttf), which isn't present on most
Linux systems, and cannot be redistributed. After this commit, it is
replaced with Bitstream Vera Sans, which can be. Existing files
are not affected.

The font name in the TTF file was artificially modified to add
the (built-in) suffix, which will need to be done if more built-in
fonts are added.
2019-02-11 11:03:47 +00:00
Bauke Conijn e69478e61a Let tangent arc modify the original entities.
Modifying the original entities instead of deleting them, retains the
original associated constraints. This makes creating rounded rectangles
a lot easier.
2019-02-11 10:45:11 +00:00
whitequark f324477dd0 Implement a platform abstraction for windows.
This commit removes a large amount of code partially duplicated
between the text and the graphics windows, and opens the path to
having more than one model window on screen at any given time,
as well as simplifies platform work.

This commit also adds complete support for High-DPI device pixel
ratio. It adds support for font scale factor (a fractional factor
on top of integral device pixel ratio) on the platform side, but not
on the application side.

This commit also adds error checking to all Windows API calls
(within the abstracted code) and fixes a significant number of
misuses and non-future-proof uses of Windows API.

This commit also makes uses of Windows API idiomatic, e.g. using
the built-in vertical scroll bar, native tooltips, control
subclassing instead of hooks in the global dispatch loop, and so on.

It reinstates tooltip support and removes menu-related hacks.
2018-07-17 13:31:17 +00:00
Bauke Conijn 8192c965ea Show degrees of freedom in property browser. 2018-07-13 04:29:36 +00:00
Guido d471e65e7d Implement splitting at point with "Split Curves at Intersection". 2018-07-12 18:39:19 +00:00
EvilSpirit a16c204304 Allow using m (in addition to mm and inch) as base unit. 2018-07-12 12:01:46 +00:00
whitequark 85b4b25278 Fix a crash changing g->meshCombine when g->type!=EXTRUDE. 2017-04-16 02:12:31 +00:00
whitequark e5259d7a3e Swap arc endpoints when pasting transformed with negative scale. 2017-04-12 04:51:23 +00:00
EvilSpirit 99f6ea34f1 Add an option to display areas of closed contours.
This is useful e.g. for architectural work.
2017-04-08 16:43:06 +00:00
EvilSpirit 8fd11f4886 Fix forcing NURBS to mesh in a step group when the flag is inherited.
Before this commit, if the source group of a step rotate/translate
group is forced to triangle mesh, the UI would show that the step
rotate/translate group is also forced to triangle mesh, but the group
would in fact contain NURBS surfaces.
2017-04-06 07:40:47 +00:00
whitequark b0ea9d8eb4 Allow suppressing solid model of extrude and lathe groups. 2017-04-05 18:49:18 +00:00
whitequark ca2aad7fea Remove the "style → background image" feature. 2017-03-13 01:12:58 +00:00
EvilSpirit 5744d1d599 Implement an image request. 2017-03-12 00:13:56 +00:00
whitequark 2e15f60ef6 Win32: implement support for full-screen graphics window. 2017-02-06 15:12:26 +00:00
EvilSpirit 97e71856b3 Snap point to entity when constraining to a hovered entity.
Before this commit, when a point is constrained to an entity (point,
circle, arc of circle or line segment) by clicking on it,
the resulting constraint is not necessarily satisfied, and the next
regeneration may place the newly constrained point somewhere other
than the intended position. After this commit, the parameters
are modified to satisfy the constraint.
2017-02-06 14:20:19 +00:00
EvilSpirit 86f229c5e6 Render points corresponding to a DOF in the front layer.
Before this commit, if any rendering mode except "show all occluded"
is enabled, points can be highlighted for corresponding to a DOF
after "Analyze → Degrees of Freedom" but then promptly occluded,
which is confusing.
2017-01-20 11:46:31 +00:00
EvilSpirit db75e06ecc Add a command to show center of mass, assuming uniform density. 2017-01-19 08:54:11 +00:00
whitequark e388d9fd16 List applied constraints when selecting an entity. 2017-01-17 11:43:45 +00:00
whitequark 5d9356a90a List constrained requests when selecting a constraint. 2017-01-17 11:32:50 +00:00
EvilSpirit 5c34b3f6ef Allow copying and pasting of datum points. 2017-01-14 03:17:09 +00:00
EvilSpirit 43db2201fd Turn newly created redundant constraints with a label into references.
This is a fairly standard CAD feature; it conveys the same
information and has the same recovery path, without erroring out,
so seems like an obvious win.
2017-01-12 01:34:41 +00:00
whitequark 855de072be Automatically constrain arc or rectangle points. 2017-01-11 04:17:14 +00:00
whitequark 02ab358bd9 Allow the digit group separator, "_", in expressions. 2017-01-02 23:34:36 +00:00
whitequark daf3c7b070 GTK, Win32: always map keypad decimal separator to dot.
We only accept dot as a decimal separator, but the OS locale
may use a comma there.
2017-01-02 23:34:18 +00:00
EvilSpirit 25631d4fb2 Choose entities to select in a way appropriate for the operation.
Before this commit, when an entity is clicked at or dragged, and it
shares a place with other entities, which of them is selected is
decided more or less at random. This is particularly annoying when
dragging.

After this commit, when clicking, an entity from the current group
is given preference, and when dragging, an entity from a request
is given preference. This allows e.g. dragging points of a sketch
even when an extrusion of that sketch is active.
2017-01-02 12:21:01 +00:00
EvilSpirit 9148d0cb91 Force DOF check every time a constraint is added.
Before this commit, it was possible to add some redundant constraints
(e.g. vertical, horizontal or midpoint) without failing the sketch,
because SolveBySubstitution() removed the redundant equations.
However, this could result in the solve failing later because
the system didn't converge, without any pointers as to the true
cause of the failure.
2016-12-21 19:40:33 +00:00
whitequark 47244c5e89 Implement a command-line interface.
This commit adds a basic command-line interface. This interface
allows rendering thumbnails and exporting data in batch mode.
2016-11-29 04:01:07 +00:00
EvilSpirit f5485cbf24 Rewrite equations generated for same-orientation constraints.
This has the same motivations and implementation as in 3d6d873.
2016-11-27 14:25:50 +00:00
EvilSpirit 78d141cf9c Rewrite equations generated for curve-line tangent constraints (in 3d).
This has the same motivations and implementation as in 3d6d873.
2016-11-27 14:25:44 +00:00
EvilSpirit 3d6d873906 Rewrite equations generated for parallel constraints (in 3d).
Before this commit, parallel constraints in 3d are fragile:
constraints that are geometrically fine can end up singular anyway
because VectorsParallel() pivots wrong but converges anyway.
After this commit, much like in cc07058, the constraints are written
in a different form: instead of trying to remove two degrees of
freedom out of three, all three are removed, and one added; namely,
the constraint introduces a free parameter, signed length ratio.
2016-11-27 13:43:48 +00:00
EvilSpirit cc07058e48 Rewrite equations generated for pt-on-line constraints.
Before this commit, pt-on-line constraints are buggy. To reproduce,
extrude a circle, then add a datum point and constrain it to the
axis of the circle, then move it. The cylinder will collapse.

To quote Jonathan:

> On investigation, I (a) confirm that the problem is
> the unconstrained extrusion depth going to zero, and (b) retract
> my earlier statement blaming extrude and other similar non-entity
> parameter treatment for this problem; you can easily reproduce it
> with a point in 3d constrained to lie on any line whose length
> is free.
>
> PT_ON_LINE is written using VectorsParallel, for no obvious reason.
> Rewriting that constraint to work on two projected distances (using
> any two basis vectors perpendicular to the line) should fix that
> problem, since replacing the "point on line in 3d" constraint with
> two "point on line in 2d" constraints works. That still has
> the hairy ball problem of choosing the basis vectors, which you
> can't do with a continuous function; you'd need Vector::Normal()
> or equivalent.
>
> You could write three equations and make the constraint itself
> introduce one new parameter for t. I don't know how well that
> would work numerically, but it would avoid the hairy ball problem,
> perhaps elegant at the cost of speed.

Indeed, this commit implements the latter solution: it introduces
an additional free parameter. The point being coincident with
the start of the line corresponds to the parameter being zero, and
point being coincident with the end corresponds to one).

In effect, instead of constraining two of three degrees of freedom
(for which the equations do not exist because of the hairy ball
theorem), it constrains three and adds one more.
2016-11-26 19:35:38 +00:00
EvilSpirit 8f93136d8a DXF: Import Z coordinate from DXF/DWG files. 2016-11-26 08:25:54 +00:00
whitequark 41365c5f9f DXF: Fix export of wireframe as 3D DXF.
Before this commit, polylines got flattened but all other entities
got exported with the proper Z coordinate. After this commit, all
entities are exported with proper Z coordinate.

Also, instead of exporting LWPOLYLINE (2d only), POLYLINE (2d/3d)
is exported; as a bonus it is more compatible with 3rd party
software, since it is older.
2016-11-26 08:18:14 +00:00
whitequark 9a0f2c3601 Fix detection of transparent meshes.
SSurface::TriangulateInto first populates the mesh with triangles
that have no color, and then paints them, which confused the code
that detects if a mesh is transparent into thinking that all of them
are; and that broke the "draw back faces in red" feature, since it
is disabled for transparent meshes.
2016-11-18 11:38:45 +00:00