@@ -42,6 +42,46 @@ export class VerbCurve {
4242 return this . context . verb . geom . NurbsCurve . byPoints ( inputs . points , inputs . degree ) ;
4343 }
4444
45+ /**
46+ * Converts lines to NURBS curves
47+ * Returns array of the verbnurbs Line objects
48+ * @param inputs Lines to be transformed to curves
49+ * @returns Verb nurbs curves
50+ */
51+ convertLinesToNurbsCurves ( inputs : Inputs . Verb . LinesDto ) : any [ ] {
52+ return inputs . lines . map ( line => new this . context . verb . geom . Line ( line . start , line . end ) ) ;
53+ }
54+
55+ /**
56+ * Converts line to NURBS curve
57+ * Returns the verbnurbs Line object
58+ * @param inputs Line to be transformed to curve
59+ * @returns Verb nurbs curves
60+ */
61+ convertLineToNurbsCurve ( inputs : Inputs . Verb . LineDto ) : any {
62+ return new this . context . verb . geom . Line ( inputs . line . start , inputs . line . end ) ;
63+ }
64+
65+ /**
66+ * Converts a polyline to a NURBS curve
67+ * Returns the verbnurbs NurbsCurve object
68+ * @param inputs Polyline to be transformed to curve
69+ * @returns Verb nurbs curve
70+ */
71+ convertPolylineToNurbsCurve ( inputs : Inputs . Verb . PolylineDto ) : any {
72+ return this . context . verb . geom . NurbsCurve . byPoints ( inputs . polyline . points , 1 ) ;
73+ }
74+
75+ /**
76+ * Converts a polylines to a NURBS curves
77+ * Returns the verbnurbs NurbsCurve objects
78+ * @param inputs Polylines to be transformed to curves
79+ * @returns Verb nurbs curves
80+ */
81+ convertPolylinesToNurbsCurves ( inputs : Inputs . Verb . PolylinesDto ) : any [ ] {
82+ return inputs . polylines . map ( polyline => this . convertPolylineToNurbsCurve ( { polyline } ) ) ;
83+ }
84+
4585 /**
4686 * Creates a Bezier Nurbs curve by providing control points and weights
4787 * @param inputs Control points
0 commit comments