Skip to content

Commit

Permalink
HPGL: change velocity to int (#286)
Browse files Browse the repository at this point in the history
- write -f hpgl now only accepts int for -velocity/--vs
- HPGL outputs VS command with int value only

Fixes# 255
  • Loading branch information
abey79 authored Jun 7, 2021
1 parent 23b4846 commit 9f7837c
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 17 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@

#### 1.7 (UNRELEASED)

**Important**: for a normal installation, *vpype* must now be installed/updated with the following command:
**Important**: for a regular installation, *vpype* must now be installed/updated with the following command:
```
pip install -U vpype[all]
```


New features and improvements:
* The viewer (`show` command) and its dependencies is no longer required and is installed only if the `all` extra is provided to `pip`:
```
Expand All @@ -20,6 +19,7 @@ Bug fixes:
* Fixed systematic crash when using the Windows installer (#285)
* Fixed an issue where `read` would crash with empty `<polygon>` tags and similar degenerate geometries (#260)
* Fixed an issue where `linesimplify` would skip layers containing a single line (#280)
* Fixed an issue where floating point value could be generated for HPGL VS commands (#286)

Other changes:
* Updated to Click 8.0.1 (#282)
Expand Down
26 changes: 14 additions & 12 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions vpype/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ def write_hpgl(
landscape: bool,
center: bool,
device: Optional[str],
velocity: Optional[float],
velocity: Optional[int],
quiet: bool = False,
) -> None:
"""Create a HPGL file from the :class:`Document` instance.
Expand Down Expand Up @@ -608,7 +608,7 @@ def complex_to_str(p: complex) -> str:

output.write("IN;DF;")
if velocity is not None:
output.write(f"VS{velocity};")
output.write(f"VS{int(velocity)};")
if paper_config.set_ps is not None:
output.write(f"PS{int(paper_config.set_ps)};")

Expand Down
2 changes: 1 addition & 1 deletion vpype_cli/write.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@
@click.option(
"-vs",
"--velocity",
type=float,
type=int,
help="[HPGL only] Emit a VS command with the provided value.",
)
@click.option(
Expand Down

0 comments on commit 9f7837c

Please sign in to comment.