Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENH: default location to store STLs to is users home #4

Merged
merged 1 commit into from
Feb 6, 2022
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
5 changes: 3 additions & 2 deletions mapa/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from pathlib import Path
from typing import Union

import click
import numpy as np
Expand Down Expand Up @@ -92,15 +93,15 @@ def convert_tif_to_stl(
input_file: str,
as_ascii: bool,
model_size: int,
output_file: str,
output_file: Union[str, None],
max_res: bool,
z_offset: float,
z_scale: float,
make_square: bool,
) -> Path:
_verify_input_is_valid(input_file)
if output_file is None:
output_file = Path.cwd() / str(Path(input_file).name).replace(".tiff", ".stl").replace(".tif", ".stl")
output_file = Path.home() / str(Path(input_file).name).replace(".tiff", ".stl").replace(".tif", ".stl")
_verify_output_is_valid(output_file)

tiff = rio.open(input_file)
Expand Down
3 changes: 2 additions & 1 deletion mapa/cli.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import subprocess
from pathlib import Path
from typing import Union

import click

Expand Down Expand Up @@ -51,7 +52,7 @@
@click.version_option()
def dem2stl(
input: str,
output: str,
output: Union[str, None],
z_offset: float,
z_scale: float,
max_res: bool = False,
Expand Down