From 1a19c238e3741931db9e61b6a0b79259b5ed0753 Mon Sep 17 00:00:00 2001 From: "bozo.kopic" Date: Wed, 22 Dec 2021 19:35:48 +0100 Subject: WIP c implementation --- playground/.gitignore | 2 +- playground/calculate.sh | 4 ++-- playground/generate_output.sh | 2 +- playground/native-calculate.sh | 8 ++++++++ playground/params.json | 16 ++++++++++++++++ playground/params.yaml | 12 ------------ 6 files changed, 28 insertions(+), 16 deletions(-) create mode 100755 playground/native-calculate.sh create mode 100644 playground/params.json delete mode 100644 playground/params.yaml (limited to 'playground') diff --git a/playground/.gitignore b/playground/.gitignore index 70dafff..81442ae 100644 --- a/playground/.gitignore +++ b/playground/.gitignore @@ -1,3 +1,3 @@ -/result.yaml +/result.json /output.pdf /output.svg diff --git a/playground/calculate.sh b/playground/calculate.sh index 2db0ada..bff0e14 100755 --- a/playground/calculate.sh +++ b/playground/calculate.sh @@ -3,6 +3,6 @@ . $(dirname -- "$0")/env.sh exec $PYTHON -m opcut calculate \ - --params $RUN_PATH/params.yaml \ - --result $RUN_PATH/result.yaml \ + --params $RUN_PATH/params.json \ + --result $RUN_PATH/result.json \ "$@" diff --git a/playground/generate_output.sh b/playground/generate_output.sh index 1eaae94..0139233 100755 --- a/playground/generate_output.sh +++ b/playground/generate_output.sh @@ -4,6 +4,6 @@ exec $PYTHON -m opcut generate_output \ --output-type pdf \ - --result $RUN_PATH/result.yaml \ + --result $RUN_PATH/result.json \ --output $RUN_PATH/output.pdf \ "$@" diff --git a/playground/native-calculate.sh b/playground/native-calculate.sh new file mode 100755 index 0000000..06756ba --- /dev/null +++ b/playground/native-calculate.sh @@ -0,0 +1,8 @@ +#!/bin/sh + +. $(dirname -- "$0")/env.sh + +exec $ROOT_PATH/build/c/opcut-calculate \ + --method greedy \ + --output result.json \ + params.json diff --git a/playground/params.json b/playground/params.json new file mode 100644 index 0000000..789505c --- /dev/null +++ b/playground/params.json @@ -0,0 +1,16 @@ +{ + "cut_width": 1, + "panels": { + "p1": { + "width": 50, + "height": 50 + } + }, + "items": { + "i1": { + "width": 5, + "height": 5, + "can_rotate": true + } + } +} diff --git a/playground/params.yaml b/playground/params.yaml deleted file mode 100644 index 605acec..0000000 --- a/playground/params.yaml +++ /dev/null @@ -1,12 +0,0 @@ ---- -cut_width: 1 -panels: - p1: - width: 50 - height: 50 -items: - i1: - width: 5 - height: 5 - can_rotate: true -... -- cgit v1.2.3-70-g09d2