Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Added

- **Extrude Twist**: Options **Twist** checkbox. Two-phase flow locks height first, then sets twist angle about the face centroid (mouse, or <kbd>Shift+Tab</kbd> for degrees). Height length dim is cleared on lock; a temporary angle annotation on the extruded front face shows degrees during twist. With **Both sides**, ends twist symmetrically by +/- half the angle. Geometry uses ruled thru-sections with compatibility off (keeps tooth pairing) and cuts twisted hole solids so face bores survive; straight prism when twist is zero. Dense-face **Extrude fast preview** also applies during Twist (face copies translate and rotate; finalize builds the solid).

## [0.4.0] - 2026-07-25

### Performance
Expand Down
4 changes: 2 additions & 2 deletions docs/usage-settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ Between those, the pane has collapsible sections. Expand a section to see its co
- **Edge selection color** / **Edge highlight color** — selected edges vs mouse-over (dynamic) highlight (RGBA)
- **Face fill color** / **Face selection fill** / **Face highlight fill** — normal fill, selected fill, and mouse-over fill (RGBA)
- **Shapes in sketch mode** — **Enabled** checkbox (same as **Options -> Faint shapes**; default on). When enabled: *Off (hide)*, *Ghost*, or *Wire* style (default **Ghost**), and **Shape Faint Strength** (**5%** to **85%**, default **14%**; Ghost and Wire). Higher strength looks closer to normal inspection opacity. **Shape List -> Hide all** still hides every shape. Screenshot: [Sketching (2D)](usage-sketch.md#sketching-2d).
- **Extrude fast preview** — **Enabled** (default on): when extruding a sketch face with more edges than **Fast preview edge count** (default **24**), the drag preview moves face copies instead of rebuilding a solid (responsive on dense profiles such as imported cross-sections). Simple faces still show a shaded solid while dragging. With Options **Both sides**, both ends show a face copy. Finalize always builds the solid. See [Extrude](usage.md#extrude-sketch-face-tool-e).
- **Extrude fast preview** — **Enabled** (default on): when extruding a sketch face with more edges than **Fast preview edge count** (default **24**), the drag preview moves face copies instead of rebuilding a solid (responsive on dense profiles such as imported cross-sections). With Options **Twist**, those copies also rotate about the face center. Simple faces still show a shaded solid while dragging. With Options **Both sides**, both ends show a face copy. Finalize always builds the solid. See [Extrude](usage.md#extrude-sketch-face-tool-e).
- **Dimension line width** (desktop only) — slider **0.5** to **8.0**
- **Dimension arrow size** — slider **1.0** to **24.0**
- **Dimension color** — RGB for dimension lines, arrow heads, and value text
Expand Down Expand Up @@ -112,7 +112,7 @@ For other non-sketch Options content, see the matching tool section in the usage
Sketch-related preferences are edited in the **Options** panel while you use a sketch tool, not in the **Settings** pane:

- **Sketch options** (all sketch tools): **Snap guide mode** (*Traditional*, *Fullscreen*, *Both*, *None*), then **Snap dist** and **All co-axial nodes** (global co-axial grid vs closest-per-axis only; both hidden when mode is *None*), and **Faint shapes** (show document solids as ghost/wire while sketching; style and **Shape Faint Strength** in **Settings -> Sketch -> Appearance**). *None* disables snap-to-node and snap guides. See [How sketch snap works](usage-sketch.md#sketch-snapping). **Snap guide color (node)**, **Snap guide color (axis)**, **Snap guide line width**, **Snap guide mode**, and **All co-axial nodes** are also in **Settings -> Sketch -> Snap** (persisted in `gui.*` keys below).
- **Extrude sketch face**: under **Extrude**, **Both sides** and **Material** for the new solid (same document preset as **Normal** mode Options **Material**). Fast drag preview for dense faces is configured in **Settings -> Sketch -> Appearance** (**Extrude fast preview**). Other modes that still show **Material** in Options use that same preset when relevant (for example **Sketch from planar face**).
- **Extrude sketch face**: under **Extrude**, **Both sides**, **Twist**, and **Material** for the new solid (same document preset as **Normal** mode Options **Material**). With **Twist** on, the first drag sets height, then a second drag sets twist angle about the face center; <kbd>Tab</kbd> / <kbd>Shift+Tab</kbd> enter height / angle. Fast drag preview for dense faces is configured in **Settings -> Sketch -> Appearance** (**Extrude fast preview**); with **Twist**, face copies rotate as well as translate. Other modes that still show **Material** in Options use that same preset when relevant (for example **Sketch from planar face**).
- **Add edge** / **Add node** (and similar): a **Shortcuts** line documents TAB / Shift+TAB typing behavior.
- **Add line edge**: under **Options**, **Add midpoint nodes** ([usage-sketch.md#line-edge-option-add-midpoint-nodes](usage-sketch.md#line-edge-option-add-midpoint-nodes)) and **Place from center** ([usage-sketch.md#line-edge-option-place-from-center](usage-sketch.md#line-edge-option-place-from-center)); each has a **?** link. See also [Line edge Options](usage-sketch.md#line-edge-options). The midpoint setting is also in **Settings -> Sketch -> Nodes** (persisted).
- **Sketch operation** (mirror / revolve axis): mirror, revolve, angle, and clear-axis actions (see [usage-sketch.md](usage-sketch.md#operation-axis-tool)).
Expand Down
23 changes: 13 additions & 10 deletions docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -493,8 +493,9 @@ The extrude tool allows you to create 3D solid shapes by extruding 2D sketch fac
| **Orthographic camera** | Extrude mode forces **orthographic** projection (same as other sketch tools) so extrusion height is easier to judge without perspective foreshortening |
| **Direct face selection** | Click directly on a sketch face to select it for extrusion, or use **`E`** / right-click **Extrude** on a face in the [Sketch List](#sketch-list) |
| **Automatic view adjustment** | The view automatically rotates if the face plane is parallel to the view plane (within 5 degrees), providing better visibility for the extrusion operation |
| **Real-time preview** | See the extrusion update while dragging. Simple faces show a shaded solid. Dense faces (many edges) can use a fast preview that moves face copies - enable or tune this in **Settings -> Sketch -> Appearance -> Extrude fast preview**. With **Both sides**, both ends are annotated. Finalize always creates the solid |
| **Real-time preview** | See the extrusion update while dragging. Simple faces show a shaded solid. Dense faces (many edges) can use a fast preview that moves face copies (translate, and rotate when **Twist** is on) - enable or tune this in **Settings -> Sketch -> Appearance -> Extrude fast preview**. With **Both sides**, both ends are annotated. Finalize always creates the solid |
| **Interactive distance control** | Drag the mouse to adjust extrusion distance, or use the distance input dialog (<kbd>Tab</kbd> key) for precise control |
| **Twist** | Options **Twist**: after locking height (click or <kbd>Tab</kbd> commit), the height dimension is removed and a temporary angle annotation on the extruded front face shows twist in degrees. Drag to rotate the far end about the face center, or <kbd>Shift+Tab</kbd> for an exact angle. With **Both sides**, the mid-plane stays unrotated and each end twists by half the angle in opposite directions |
| **Distance annotation** | A dimension annotation displays the current extrusion distance |
| **Bidirectional extrusion** | The extrusion direction is determined by which side of the face plane you move the mouse to |

Expand All @@ -507,24 +508,26 @@ The extrude tool allows you to create 3D solid shapes by extruding 2D sketch fac
- **Mouse drag**: Move the mouse to adjust the extrusion distance in real-time
- **Precise input**: Press <kbd>Tab</kbd> to open the distance input dialog and enter an exact extrusion distance
- The distance annotation shows the current extrusion distance
4. **Finalize**: Click the <kbd>left mouse button</kbd> to confirm and create the extruded shape
5. **Cancel**: Press <kbd>Esc</kbd> at any time to cancel the extrusion operation
4. **Twist (optional)**: Enable **Twist** in Options. After locking height with a left click (or committing distance with <kbd>Tab</kbd>), move the mouse around the face center to set the twist angle, or press <kbd>Shift+Tab</kbd> for degrees
5. **Finalize**: Click the <kbd>left mouse button</kbd> to confirm and create the extruded shape (second click when Twist is on, after the height lock)
6. **Cancel**: Press <kbd>Esc</kbd> at any time to cancel the extrusion operation

**Keyboard Shortcuts:**

| | |
| ---------------: | --------------------------------------------------------- |
| <kbd>E</kbd> | Activate extrude mode |
| <kbd>Tab</kbd> | Open distance input dialog for precise extrusion distance |
| <kbd>Esc</kbd> | Cancel current extrusion operation |
| <kbd>Enter</kbd> | Finalize extrusion (when using distance input) |
| | |
| -------------------: | ------------------------------------------------------------------------------ |
| <kbd>E</kbd> | Activate extrude mode |
| <kbd>Tab</kbd> | Open distance input for extrusion height (height phase) |
| <kbd>Shift+Tab</kbd> | Open angle input for twist (twist phase, when **Twist** is on) |
| <kbd>Esc</kbd> | Cancel current extrusion operation |
| <kbd>Enter</kbd> | Commit distance/angle input (height commit enters twist when **Twist** is on) |

**Tips:**
- Extrude uses an **orthographic** camera (projection mode). Perspective from Normal mode is restored when you leave Extrude.
- Extrude works best when the view is not directly parallel to the sketch plane - the system will automatically rotate the view if needed
- Use the distance input dialog for precise measurements
- The extrusion direction depends on which side of the face plane you move the mouse to
- Dense faces (for example imported cross-section outlines) use a fast drag preview when **Settings -> Sketch -> Appearance -> Extrude fast preview** is enabled; turn it off to always drag a full shaded solid
- Dense faces (for example imported cross-section outlines) use a fast drag preview when **Settings -> Sketch -> Appearance -> Extrude fast preview** is enabled (face copies translate, and rotate when **Twist** is on); turn it off to always drag a full shaded solid
- Multiple faces from the same sketch can be extruded separately
- Extruded shapes can be used in [boolean operations](#boolean-operations) (cut, fuse, common)

Expand Down
4 changes: 2 additions & 2 deletions src/doc/gui.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ Always calls `m_view->on_mouse_move(screen_coords)` first.
| Event | Handler |
| --------------------------- | -------------------------------------------------------------------------------------------------------------------- |
| LMB (underlay calib active) | `try_underlay_calib_click_` (early return) |
| LMB | `m_view->on_mouse_button` then `on_left_click_` (skipped when extrude finalize already consumed the press) |
| LMB | `m_view->on_mouse_button` then `on_left_click_` (skipped when extrude LMB already advanced/finalized the session) |
| RMB press | `finalize_elm` for line / multi-line sketch modes |
| LMB in `on_left_click_` | Mode-specific: transform finalize, sketch `add_sketch_pt`, fillet/chamfer click, polar dup `add_point`, extrude pick |

Expand All @@ -194,7 +194,7 @@ Tests use `sketch_left_click` to simulate sketch LMB without ImGui mouse positio
| `Sketch_inspection_mode` | `options_sketch_common_` |
| Each sketch tool mode | Matching `options_sketch_*_mode_` |
| `Sketch_operation_axis` | Mirror / Revolve / Clear axis |
| `Sketch_face_extrude` | Both sides, material; help mentions Settings fast preview |
| `Sketch_face_extrude` | Both sides, Twist, material; help mentions Settings fast preview |

Shared sketch controls (snap, midpoint nodes, place-from-center) live in `options_sketch_common_` and helpers in `gui_mode.cpp`.

Expand Down
Loading
Loading