@@ -262,7 +262,7 @@ pub fn arcs_to_polylines_single(arcs: &Vec<Arc>) -> Polyline {
262262 if arc. is_seg ( ) {
263263 ( arc. a , arc. b , 0.0 )
264264 } else {
265- let bulge = arc_bulge_from_points ( arc. a , arc. b , arc. c , arc. r ) ;
265+ let bulge = bulge_from_arc ( arc. a , arc. b , arc. c , arc. r ) ;
266266 ( arc. a , arc. b , bulge)
267267 }
268268 } else {
@@ -277,7 +277,7 @@ pub fn arcs_to_polylines_single(arcs: &Vec<Arc>) -> Polyline {
277277 if arc. is_seg ( ) {
278278 ( arc. a , arc. b , 0.0 )
279279 } else {
280- let bulge = arc_bulge_from_points ( arc. a , arc. b , arc. c , arc. r ) ;
280+ let bulge = bulge_from_arc ( arc. a , arc. b , arc. c , arc. r ) ;
281281 ( arc. a , arc. b , bulge)
282282 }
283283 } else {
@@ -286,7 +286,7 @@ pub fn arcs_to_polylines_single(arcs: &Vec<Arc>) -> Polyline {
286286 ( arc. b , arc. a , 0.0 )
287287 } else {
288288 // For reversed arc, we need to negate the bulge
289- let forward_bulge = arc_bulge_from_points ( arc. a , arc. b , arc. c , arc. r ) ;
289+ let forward_bulge = bulge_from_arc ( arc. a , arc. b , arc. c , arc. r ) ;
290290 ( arc. b , arc. a , -forward_bulge)
291291 }
292292 }
@@ -310,7 +310,7 @@ mod test_arcs_to_polylines {
310310 // First arc: from (0,0) to (1,0) - line segment
311311 arcseg( point( 0.0 , 0.0 ) , point( 1.0 , 0.0 ) ) ,
312312 // Second arc: from (1,0) to (0,1) - quarter circle
313- arc_circle_parametrization ( point( 1.0 , 0.0 ) , point( 0.0 , 1.0 ) , 1.0 ) ,
313+ arc_from_bulge ( point( 1.0 , 0.0 ) , point( 0.0 , 1.0 ) , 1.0 ) ,
314314 // Third arc: from (0,1) to (0,0) - line segment (completing the loop)
315315 arcseg( point( 0.0 , 1.0 ) , point( 0.0 , 0.0 ) ) ,
316316 ] ;
@@ -342,7 +342,7 @@ mod test_arcs_to_polylines {
342342 arcseg( point( 0.0 , 0.0 ) , point( 1.0 , 0.0 ) ) ,
343343 // Second arc: reversed orientation (from (0,1) to (1,0) instead of (1,0) to (0,1))
344344 // This should be detected and corrected
345- arc_circle_parametrization ( point( 0.0 , 1.0 ) , point( 1.0 , 0.0 ) , 1.0 ) ,
345+ arc_from_bulge ( point( 0.0 , 1.0 ) , point( 1.0 , 0.0 ) , 1.0 ) ,
346346 ] ;
347347
348348 // Convert to polyline
@@ -518,15 +518,15 @@ pub fn offsetsegment(arc: Arc, is_arc: bool) -> OffsetSegment {
518518
519519// #[test]
520520// fn test_new() {
521- // let arc = arc_circle_parametrization (point(1.0, 2.0), point(3.0, 4.0), 3.3);
521+ // let arc = arc_from_bulge (point(1.0, 2.0), point(3.0, 4.0), 3.3);
522522// let o0 = OffsetRaw::new(arc, point(5.0, 6.0), 3.3);
523523// let o1 = offsetraw(arc, point(5.0, 6.0), 3.3);
524524// assert_eq!(o0, o1);
525525// }
526526
527527// #[test]
528528// fn test_display() {
529- // let arc = arc_circle_parametrization (point(1.0, 2.0), point(3.0, 4.0), 3.3);
529+ // let arc = arc_from_bulge (point(1.0, 2.0), point(3.0, 4.0), 3.3);
530530// let o0 = OffsetRaw::new(arc, point(5.0, 6.0), 3.3);
531531// assert_eq!("[[[1.00000000000000000000, 2.00000000000000000000], [3.00000000000000000000, 4.00000000000000000000], [3.49848484848484808651, 1.50151515151515169144], 2.54772716009334887488], [5.00000000000000000000, 6.00000000000000000000], 3.3]", format!("{}", o0));
532532// }
@@ -556,7 +556,7 @@ const ZERO: f64 = 0f64;
556556// fn arc_offset(v0: PVertex, v1: PVertex, offset: f64) -> OffsetRaw {
557557// let bulge = v0.g;
558558// // arc is always CCW
559- // let param = arc_circle_parametrization (v0.p, v1.p, bulge);
559+ // let param = arc_from_bulge (v0.p, v1.p, bulge);
560560// let v0_to_center = v0.p - param.c;
561561// let v0_to_center = v0_to_center.normalize();
562562// let v1_to_center = v1.p - param.c;
@@ -1308,7 +1308,7 @@ pub fn check_if_segments_intersect(off0: OffsetSegment, off1: OffsetSegment) ->
13081308// #[ignore = "Generate coordinate for tests"]
13091309// fn test_connect_offset_segments4() {
13101310// // Calculates parametric point in the arc
1311- // let arc = arc_circle_parametrization (point(50.0, 150.0), point(-20.0, 150.0), 1.0);
1311+ // let arc = arc_from_bulge (point(50.0, 150.0), point(-20.0, 150.0), 1.0);
13121312// let offset = arc_offset(pvertex(arc.a, 1.0), pvertex(arc.b, 1.0), 32.0);
13131313
13141314// let theta = 125_f64.to_radians();
@@ -1440,12 +1440,12 @@ pub fn check_if_segments_intersect(off0: OffsetSegment, off1: OffsetSegment) ->
14401440// fn test_circle_with_two_close_lines() {
14411441// let mut svg = svg(300.0, 350.0);
14421442// let bul = 1.6;
1443- // let arc0 = arc_circle_parametrization (point(100.0, 100.0), point(100.0, 160.0), bul);
1444- // let arc1 = arc_circle_parametrization (point(90.0, 130.0), point(150.0, 190.0), 0f64);
1445- // let arc2 = arc_circle_parametrization (point(94.0, 130.0), point(154.0, 190.0), 0f64);
1443+ // let arc0 = arc_from_bulge (point(100.0, 100.0), point(100.0, 160.0), bul);
1444+ // let arc1 = arc_from_bulge (point(90.0, 130.0), point(150.0, 190.0), 0f64);
1445+ // let arc2 = arc_from_bulge (point(94.0, 130.0), point(154.0, 190.0), 0f64);
14461446// let mut offsets = vec![arc0, arc1, arc2];
14471447// svg.offset_segments(&offsets, "red");
1448- // let arc = arc_circle_parametrization (point(100.0, 100.0), point(100.0, 160.0), bul);
1448+ // let arc = arc_from_bulge (point(100.0, 100.0), point(100.0, 160.0), bul);
14491449// svg.circle(&circle(arc.c, 0.5), "red");
14501450
14511451// offset_resolve_self_intersect(&mut offsets);
@@ -1459,11 +1459,11 @@ pub fn check_if_segments_intersect(off0: OffsetSegment, off1: OffsetSegment) ->
14591459// fn test_two_circles_one_point() {
14601460// let mut svg = svg(300.0, 350.0);
14611461// let bul = -1.6;
1462- // let arc0 = arc_circle_parametrization (point(100.0, 100.0), point(200.0, 100.0), bul);
1463- // let arc1 = arc_circle_parametrization (point(100.0, 100.0), point(200.0, 100.0), bul);
1462+ // let arc0 = arc_from_bulge (point(100.0, 100.0), point(200.0, 100.0), bul);
1463+ // let arc1 = arc_from_bulge (point(100.0, 100.0), point(200.0, 100.0), bul);
14641464// let mut offsets = vec![arc0, arc1];
14651465// svg.offset_segments(&offsets, "red");
1466- // //let arc = arc_circle_parametrization (point(100.0, 100.0), point(100.0, 160.0), bul);
1466+ // //let arc = arc_from_bulge (point(100.0, 100.0), point(100.0, 160.0), bul);
14671467// offset_resolve_self_intersect(&mut offsets);
14681468// svg.offset_segments(&offsets, "black");
14691469// svg.write();
@@ -1506,8 +1506,8 @@ pub fn check_if_segments_intersect(off0: OffsetSegment, off1: OffsetSegment) ->
15061506// let p01 = point(100.0, 200.0);
15071507// let p10 = point(200.0, 100.0);
15081508// let p11 = point(200.0, 200.0);
1509- // let arc0 = arc_circle_parametrization (p00, p01, 1.5);
1510- // let arc1 = arc_circle_parametrization (p10, p11, -1.5);
1509+ // let arc0 = arc_from_bulge (p00, p01, 1.5);
1510+ // let arc1 = arc_from_bulge (p10, p11, -1.5);
15111511
15121512// let mut offset = vec![arc0, arc1];
15131513// svg.offset_segments(&offset, "red");
@@ -1523,10 +1523,10 @@ pub fn check_if_segments_intersect(off0: OffsetSegment, off1: OffsetSegment) ->
15231523// let mut oarc: Vec<OffsetSegment> = Vec::with_capacity(pline.len());
15241524// let last = pline.len() - 2;
15251525// for i in 0..=last {
1526- // let offseg = arc_circle_parametrization (pline[i].p, pline[i + 1].p, pline[i].g);
1526+ // let offseg = arc_from_bulge (pline[i].p, pline[i + 1].p, pline[i].g);
15271527// oarc.push(offseg);
15281528// }
1529- // let offseg = arc_circle_parametrization (
1529+ // let offseg = arc_from_bulge (
15301530// pline.last().unwrap().p,
15311531// pline.first().unwrap().p,
15321532// pline.last().unwrap().g,
@@ -2035,12 +2035,12 @@ fn polyline_to_arcs_single(pline: &Polyline) -> Vec<Arc> {
20352035 let mut arcs = Vec :: with_capacity ( pline. len ( ) + 1 ) ;
20362036 let last = pline. len ( ) - 1 ;
20372037 for i in 0 ..last {
2038- let arc = arc_circle_parametrization ( pline[ i] . p , pline[ i + 1 ] . p , pline[ i] . b ) ;
2038+ let arc = arc_from_bulge ( pline[ i] . p , pline[ i + 1 ] . p , pline[ i] . b ) ;
20392039 arcs. push ( arc) ;
20402040 }
20412041 // last segment
20422042 let arc =
2043- arc_circle_parametrization ( pline. last ( ) . unwrap ( ) . p , pline[ 0 ] . p , pline. last ( ) . unwrap ( ) . b ) ;
2043+ arc_from_bulge ( pline. last ( ) . unwrap ( ) . p , pline[ 0 ] . p , pline. last ( ) . unwrap ( ) . b ) ;
20442044 arcs. push ( arc) ;
20452045 arcs
20462046}
@@ -2057,7 +2057,7 @@ fn polyline_to_arcs_single(pline: &Polyline) -> Vec<Arc> {
20572057// let mut offs = Vec::with_capacity(pline.len() + 1);
20582058// //let last = pline.len() - 1;
20592059// for i in 0..pline.len() - 1 {
2060- // let arc = arc_circle_parametrization (pline[i].p, pline[i + 1].p, pline[i].g);
2060+ // let arc = arc_from_bulge (pline[i].p, pline[i + 1].p, pline[i].g);
20612061// let orig = if pline[i].g < ZERO {pline[i].p} else {pline[i + 1].p};
20622062// let off = OffsetRaw {
20632063// arc,
@@ -2067,7 +2067,7 @@ fn polyline_to_arcs_single(pline: &Polyline) -> Vec<Arc> {
20672067// offs.push(off);
20682068// }
20692069// // last segment
2070- // let arc = arc_circle_parametrization (pline.last().unwrap().p, pline[0].p, pline.last().unwrap().g);
2070+ // let arc = arc_from_bulge (pline.last().unwrap().p, pline[0].p, pline.last().unwrap().g);
20712071// let orig = if pline.last().unwrap().g < ZERO {
20722072// pline.last().unwrap().p
20732073// } else {
0 commit comments