Skip to content

Sketcher: OffsetInSketcher - Add BSpline and external geometry support - #219

Open
gbulleryahen-hash wants to merge 1 commit into
FreeCAD:masterfrom
gbulleryahen-hash:master
Open

Sketcher: OffsetInSketcher - Add BSpline and external geometry support#219
gbulleryahen-hash wants to merge 1 commit into
FreeCAD:masterfrom
gbulleryahen-hash:master

Conversation

@gbulleryahen-hash

@gbulleryahen-hash gbulleryahen-hash commented May 27, 2026

Copy link
Copy Markdown

OffsetInSketcher - v2.0

Extended version of the existing OffsetInSketcher macro with the following additions:

New features

  • BSpline support : offset is computed via the Part API (makeOffset2D), the same method used by the CAM/Path workbench
  • External geometry support : works with edges projected from other bodies/features (ExternalEdge), retrieved via ActiveSketch.ExternalGeometry
  • Corner style choice : dialog now offers two options:
    • Sharp corner (Miter)
    • Rounded corner (Arc)

Technical notes

  • All geometry (normal and external) is transformed into the sketch's local coordinate system before offset computation, ensuring correct results regardless of sketch orientation in 3D space
  • Single unified code path via wire.makeOffset2D() for all geometry types
  • Tested on FreeCAD 1.x

Compatibility

  • Requires FreeCAD >= 0.19
  • License: LGPL-2.0-or-later

sharp corner:

image image image image

Rounded corner

image image image image
  • Please check this box if you're not submitting a new macro.
  • Are you submitting a new macro ?
  • Have you followed the 'How to submit a macro' section of the README.md ?
  • Your macro has a Description in its header.
  • Your macro has a CamelCase name.
  • Your macro is named appropriately.
  • Your macro contains a Metadata section that immediately follows the header description.
  • Your macro is Python3/Qt5 compliant and tested on the latest FreeCAD stable and development releases.
  • You're including documentation on how your macro works
  • Commit message is well-written
  • Commit message is titled in the following way [MacroName] Short description.
  • Optional, write or update the changelog in the macro, from latest to oldest.
    And please remember to update the Wiki with the features added or changed once this PR is merged.
    Note: If you don't have wiki access, then please mention your contribution on the 0.19 Changelog Forum Thread.

## OffsetInSketcher - v2.0

Extended version of the existing `OffsetInSketcher` macro with the following additions:

### New features
- **BSpline support** : offset is computed via the Part API (`makeOffset2D`),
  the same method used by the CAM/Path workbench
- **External geometry support** : works with edges projected from other
  bodies/features (`ExternalEdge`), retrieved via `ActiveSketch.ExternalGeometry`
- **Corner style choice** : dialog now offers two options:
  - Sharp corner (Miter)
  - Rounded corner (Arc)

### Technical notes
- All geometry (normal and external) is transformed into the sketch's local
  coordinate system before offset computation, ensuring correct results
  regardless of sketch orientation in 3D space
- Single unified code path via `wire.makeOffset2D()` for all geometry types
- Tested on FreeCAD 1.x

### Compatibility
- Requires FreeCAD >= 0.19
- License: LGPL-2.0-or-later
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants