From cf34214c4791bfda5ab17219fb3c6cc28f150abb Mon Sep 17 00:00:00 2001 From: Frank Elsinga Date: Tue, 19 Nov 2024 00:58:37 +0100 Subject: [PATCH] tmp --- cad2osm/Cargo.toml | 6 ++++++ cad2osm/README.md | 52 +++++++++++++++++++++++++++++++++++++++++++++ cad2osm/src/main.rs | 5 +++-- 3 files changed, 61 insertions(+), 2 deletions(-) create mode 100644 cad2osm/README.md diff --git a/cad2osm/Cargo.toml b/cad2osm/Cargo.toml index e3a2f86a2..da606b988 100644 --- a/cad2osm/Cargo.toml +++ b/cad2osm/Cargo.toml @@ -2,6 +2,12 @@ name = "cad2osm" version = "0.1.0" edition = "2021" +authors = ["Frank Elsinga "] +description = "Convert Ifc CAD files to osm for simpler importing" +repository = "https://github.com/TUM-Dev/navigatum" +readme = "README.md" +license = "GPL-3.0" +keywords = ["osm", "ifc", "cad"] [dependencies] anyhow = { version = "1.0.93", features = ["backtrace"] } diff --git a/cad2osm/README.md b/cad2osm/README.md new file mode 100644 index 000000000..480670988 --- /dev/null +++ b/cad2osm/README.md @@ -0,0 +1,52 @@ +# cad2osm + +`cad2osm` is a Rust-based tool to convert CAD files from the IFC format to OSM format. + +## Installation + +To install `cad2osm`, ensure you have [Rust](https://www.rust-lang.org/) installed. Then, run: + +```sh +cargo install --git https://github.com/yourusername/cad2osm +``` + +## Usage +After installation, you can use the cad2osm command: + +```shell +cad2osm [OPTIONS] +``` +### Arguments: + +- `` floor level to assign to most of the structure +- `` path to the file to read + +### Options: +- `--floor-name ` name of the `FLOOR_LEVEL` +- `-v`, `--verbose` Increase the verbosity. Can be Repeated multiple times +- `-h`, `--help` Print help + +## Development + +> [!NOTE] +> Contributions are welcome! +> Please open an issue or submit a pull request to discuss what you need/want changed how. + +To start contributing, clone the repository: + +```shell +git clone https://github.com/TUM-Dev/navigatum.git +cd NavigaTUM/cad2osm +``` + +Build and test the project: + +```shell +cargo build +cargo test +``` +To run the program locally: + +```shell +cargo run -- 3 ./example.ifc --floor-name "Third Floor" +``` diff --git a/cad2osm/src/main.rs b/cad2osm/src/main.rs index 38dbdc056..1642c003e 100644 --- a/cad2osm/src/main.rs +++ b/cad2osm/src/main.rs @@ -16,15 +16,16 @@ struct Cli { floor_name: Option, /// floor level to assign to most of the structure floor_level: i8, - /// Turn debugging information on + /// Increase the verbosity. Can be Repeated multiple times #[arg(short, long, action = clap::ArgAction::Count)] verbose: u8, /// path to the file to read - path: std::path::PathBuf, + path: PathBuf, } fn main() -> anyhow::Result<()> { human_panic::setup_panic!(); + let args = Cli::try_parse()?; telemetry::setup_logging(args.verbose); debug!("got args: {args:?}");