@@ -32,33 +32,33 @@ namespace WorldBuilder
3232{
3333 namespace Objects
3434 {
35- BezierCurve::BezierCurve (const std::vector<Point<2 > > &p, const std::vector<double > &angle_constrains_input )
35+ BezierCurve::BezierCurve (const std::vector<Point<2 > > &p, const std::vector<double > &angle_constraints_input )
3636 {
3737 points = p;
3838 const size_t n_points = p.size ();
3939 control_points.resize (n_points-1 , {{p[0 ],p[0 ]}});
4040 lengths.resize (n_points-1 ,NaN::DSNAN);
4141 angles.resize (n_points,NaN::DSNAN);
42- std::vector<double > angle_constrains = angle_constrains_input ;
43- angle_constrains .resize (n_points,NaN::DQNAN);
42+ std::vector<double > angle_constraints = angle_constraints_input ;
43+ angle_constraints .resize (n_points,NaN::DQNAN);
4444
4545 // if no angle is provided, compute the angle as the average angle between the previous and next point.
4646 // The first angle points at the second point and the last angle points at the second to last point.
4747 // The check points are set at a distance of 1/10th the line length from the point in the direction of the angle.
48- if (std::isnan (angle_constrains [0 ]))
48+ if (std::isnan (angle_constraints [0 ]))
4949 {
5050 Point<2 > P1P2 = points[1 ]-points[0 ];
5151 angles[0 ] = atan2 (P1P2[1 ],P1P2[0 ]);
5252 }
5353 else
5454 {
55- angles[0 ] = angle_constrains [0 ];
55+ angles[0 ] = angle_constraints [0 ];
5656 }
5757
5858 for (size_t p_i = 1 ; p_i < n_points-1 ; ++p_i)
5959 {
6060 // first determine the angle
61- if (std::isnan (angle_constrains [p_i]))
61+ if (std::isnan (angle_constraints [p_i]))
6262 {
6363 // get the average angle
6464 const Point<2 > P1P2 = points[p_i-1 ]-points[p_i];
@@ -72,19 +72,19 @@ namespace WorldBuilder
7272 }
7373 else
7474 {
75- angles[p_i] = angle_constrains [p_i];
75+ angles[p_i] = angle_constraints [p_i];
7676 }
7777
7878 }
7979
80- if (std::isnan (angle_constrains [n_points-1 ]))
80+ if (std::isnan (angle_constraints [n_points-1 ]))
8181 {
8282 Point<2 > P1P2 = points[n_points-2 ]-points[n_points-1 ];
8383 angles[n_points-1 ] = atan2 (P1P2[1 ],P1P2[0 ]);
8484 }
8585 else
8686 {
87- angles[n_points-1 ] = angle_constrains [n_points-1 ];
87+ angles[n_points-1 ] = angle_constraints [n_points-1 ];
8888 }
8989
9090 if (points.size () > 2 )
0 commit comments