Skip to content

Conversation

giro-dev
Copy link
Contributor

@giro-dev giro-dev commented Oct 1, 2025

This PR adds a new offset feature to the Designer module. The offset functionality allows users to create inward or outward offsets from selected shapes, which is particularly useful for creating toolpath offsets, creating shape outlines, or generating insets for shapes.

image

Features

  • Create offsets from any selected shape or group of shapes
  • Offset direction options: inward, outward, or both
  • Configurable join styles (round, bevel, mitre) for offset corners
  • Boolean operation option to union all resulting shapes
  • Live preview of the offset result
  • Support for complex shapes and groups

Implementation details

  • Uses JTS Topology Suite for geometric operations
  • Handles various shape types through a unified interface
  • Maintains the original selection after applying offsets
  • Provides fallback handling for complex geometries that might cause errors

Usage

  1. Select one or more shapes in the Designer
  2. Open the Offset dialog from the menu
  3. Configure the offset distance, direction, and join style
  4. Toggle the "Union all" option if desired
  5. Click OK to apply the offset

The offset feature works with all cuttable entities and preserves the original selection, making it easy to continue working with both the original and offset shapes.

@giro-dev
Copy link
Contributor Author

giro-dev commented Oct 2, 2025

I've used this icon I've found but not sure if you are using a certain icon collection that cold have more coherence with the application look.

public static final String PANEL_LAYOUT_CONFIG = "fill, insets 2";
public static final String SPINNER_COL_CONSTRAINTS = "width 60:100:100, wrap";

private JSpinner offsetDistance;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be replaced with a com.willwinder.universalgcodesender.uielements.components.UnitSpinner at a later time

@@ -0,0 +1,198 @@
/*
Copyright 2021 Will Winder
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you should take credit here =)

Copy link
Contributor Author

@giro-dev giro-dev Oct 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

its my first time collaborating to an opensource project xd
thanks to point it, I'll take care in following PRs ;)

@breiler
Copy link
Collaborator

breiler commented Oct 4, 2025

Regarding the icons, I have started using Phosphor icons as they are easy to work with:
https://phosphoricons.com/?weight=fill

I try to use one color for the original since this makes it easy to convert for dark themes using the script: scripts/svg_to_icons.sh

Don't worry about that now, I think it is good enough.

@breiler breiler merged commit 131353d into winder:master Oct 4, 2025
1 check passed
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.

3 participants