Skip to content
Open
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
8 changes: 7 additions & 1 deletion boxes/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,9 @@ def __init__(self) -> None:
defaultgroup.add_argument(
"--output", action="store", type=str, default="box.svg",
help="name of resulting file")
defaultgroup.add_argument(
"--line_width", action="store", type=(lambda x: float('NaN') if x == "" else float(x)), default="",
help='line width for SVG preview and export (in mm) (default: 2x burn but at least 0.05) [\U0001F6C8](https://florianfesti.github.io/boxes/html/usermanual.html#line-width)')
def spacing_type(x):
try:
return (float(x), 0.)
Expand Down Expand Up @@ -464,7 +467,10 @@ def open(self):
self.ctx.set_line_width(0.01)
self.set_source_color(Color.BLUE)
else:
self.ctx.set_line_width(max(2 * self.burn, 0.05))
line_width = self.line_width
if line_width != line_width: # check for NaN (default)
line_width = max(2 * self.burn, 0.05)
self.ctx.set_line_width(line_width)
self.set_source_color(Color.BLACK)

self.spacing = 2 * self.burn + self.spacing[0] * self.thickness + self.spacing[1]
Expand Down
8 changes: 8 additions & 0 deletions documentation/src/usermanual.rst
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,14 @@ much smaller it is than its nominal size. The burn value should be
around half of the difference. To test the fit for several values at
once you can use the **BurnTest** generator in the "Parts and Samples" section.

line_width
..........

The line width parameter defines how wide the lines in the SVG preview
and download files are drawn. By default it is twice the burn value but
at least 0.05mm. This paramteter allows to overwrite if required by some
laser engraving software.

spacing
.......

Expand Down
Loading