Skip to content

Commit 2fbf740

Browse files
committed
Curently investigating bug
1 parent 9d54a69 commit 2fbf740

22 files changed

Lines changed: 1124 additions & 595 deletions

Cargo.lock

Lines changed: 1 addition & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ readme = "README.md"
1515

1616

1717
[dependencies]
18-
togo = "0.5"
18+
togo = { path = "../togo" }
1919
robust = "1.2"
2020

2121
[lib]

examples/graph_cycle_detection.rs

Lines changed: 0 additions & 371 deletions
This file was deleted.

examples/offset_arcline.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ fn main() {
2020
//let poly = polyline_translate(&arcs_orig, point(40.0, 100.0));
2121

2222
// Internal offsetting
23-
//let poly = polyline_reverse(&poly);
23+
//let arcs_orig = polyline_reverse(&arcs_orig);
2424
let offset_arclines = offset_arcline_to_arcline(&arcs_orig, 15.0, &mut cfg);
2525

2626
println!("Input arcline has {} vertices", arcs_orig.len());

examples/offset_arcline1000.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
use togo::{poly::{arcline1000, arcline200, poly1000}, prelude::*};
2+
use offroad::{offset::offset_arcline_to_arcline, prelude::{offset_polyline_to_polyline, pline_01, OffsetCfg}};
3+
4+
fn main() {
5+
let mut cfg = OffsetCfg::default();
6+
let mut svg = SVG::new(800.0, 800.0, Some("/tmp/arcline1000.svg"));
7+
cfg.svg = Some(&mut svg);
8+
cfg.svg_orig = true;
9+
cfg.svg_raw = true;
10+
11+
let poly = arcline1000();
12+
let _offset_polylines = offset_arcline_to_arcline(&poly, 2.0, &mut cfg);
13+
14+
if let Some(svg) = cfg.svg.as_mut(){
15+
// Write svg to file
16+
svg.write_stroke_width(0.1);
17+
}
18+
}

examples/offset_arcline200.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
use togo::{poly::{arcline1000, arcline200, poly1000}, prelude::*};
2+
use offroad::{offset::offset_arcline_to_arcline, prelude::{offset_polyline_to_polyline, pline_01, OffsetCfg}};
3+
4+
fn main() {
5+
let mut cfg = OffsetCfg::default();
6+
let mut svg = SVG::new(800.0, 800.0, Some("/tmp/arcline200.svg"));
7+
cfg.svg = Some(&mut svg);
8+
cfg.svg_orig = true;
9+
cfg.svg_raw = true;
10+
11+
let poly = arcline200();
12+
let _offset_polylines = offset_arcline_to_arcline(&poly, 2.0, &mut cfg);
13+
14+
if let Some(svg) = cfg.svg.as_mut(){
15+
// Write svg to file
16+
svg.write_stroke_width(0.1);
17+
}
18+
}

examples/offset_arcline500.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
use togo::{poly::{arcline1000, arcline200, arcline500, poly1000}, prelude::*};
2+
use offroad::{offset::offset_arcline_to_arcline, prelude::{offset_polyline_to_polyline, pline_01, OffsetCfg}};
3+
4+
fn main() {
5+
let mut cfg = OffsetCfg::default();
6+
let mut svg = SVG::new(800.0, 800.0, Some("/tmp/arcline500.svg"));
7+
cfg.svg = Some(&mut svg);
8+
cfg.svg_orig = true;
9+
cfg.svg_raw = true;
10+
11+
let poly = arcline500();
12+
let _offset_polylines = offset_arcline_to_arcline(&poly, 2.0, &mut cfg);
13+
14+
if let Some(svg) = cfg.svg.as_mut(){
15+
// Write svg to file
16+
svg.write_stroke_width(0.1);
17+
}
18+
}

examples/offset_pline1.rs

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,16 @@ fn main() {
77
let mut svg = SVG::new(300.0, 300.0, Some("/tmp/pline1.svg"));
88
cfg.svg = Some(&mut svg);
99
cfg.svg_orig = true;
10-
cfg.svg_final = true;
10+
cfg.svg_raw = true;
1111

1212
let poly_orig = pline_01()[0].clone();
1313
// Translate to fit in the SVG viewport
1414
let poly = polyline_translate(&poly_orig, point(100.0, -50.0));
1515

16-
// Offset the polyline
17-
// let offset_polylines = offset_polyline_to_polyline(&poly, 15.0, &mut cfg);
18-
// for offset_poly in offset_polylines {
19-
// svg.polyline(&offset_poly, "grey");
20-
// }
21-
16+
let _offset_polylines = offset_polyline_to_polyline(&poly, 5.0, &mut cfg);
2217
// Internal offsetting
23-
let poly = polyline_reverse(&poly);
24-
let _offset_polylines = offset_polyline_to_polyline(&poly, 15.5600615, &mut cfg);
18+
//let poly = polyline_reverse(&poly);
19+
//let _offset_polylines = offset_polyline_to_polyline(&poly, 15.5600615, &mut cfg);
2520
//let _offset_polylines = offset_polyline_to_polyline(&poly, 16.0, &mut cfg);
2621

2722
if let Some(svg) = cfg.svg.as_mut(){

output/example1_square_cycles.svg

Lines changed: 0 additions & 16 deletions
This file was deleted.

output/example2_two_triangles.svg

Lines changed: 0 additions & 22 deletions
This file was deleted.

0 commit comments

Comments
 (0)