KiCad PCB EDA Suite
Loading...
Searching...
No Matches
svg_import_plugin.cpp
Go to the documentation of this file.
1/*
2 * This program source code file is part of KICAD, a free EDA CAD application.
3 *
4 * Copyright (C) 2016 CERN
5 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
6 * @author Janito V. Ferreira Filho
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version 2
11 * of the License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, you may find one here:
20 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
21 * or you may search the http://www.gnu.org website for the version 2 license,
22 * or you may write to the Free Software Foundation, Inc.,
23 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
24 */
25
26#include "svg_import_plugin.h"
27
28#include <nanosvg.h>
29#include <algorithm>
30#include <cmath>
31#include <locale_io.h>
32
33#include <eda_item.h>
34#include "graphics_importer.h"
35
36static const int SVG_DPI = 96;
37
38static VECTOR2D calculateBezierBoundingBoxExtremity( const float* aCurvePoints,
39 std::function< const float&( const float&, const float& ) > comparator );
40static float calculateBezierSegmentationThreshold( const float* aCurvePoints );
41static void segmentBezierCurve( const VECTOR2D& aStart, const VECTOR2D& aEnd, float aOffset,
42 float aStep, const float* aCurvePoints, float aSegmentationThreshold,
43 std::vector< VECTOR2D >& aGeneratedPoints );
44static void createNewBezierCurveSegments( const VECTOR2D& aStart, const VECTOR2D& aMiddle,
45 const VECTOR2D& aEnd, float aOffset, float aStep, const float* aCurvePoints,
46 float aSegmentationThreshold, std::vector< VECTOR2D >& aGeneratedPoints );
47static VECTOR2D getBezierPoint( const float* aCurvePoints, float aStep );
48static VECTOR2D getPoint( const float* aPointCoordinates );
49static VECTOR2D getPointInLine( const VECTOR2D& aLineStart, const VECTOR2D& aLineEnd,
50 float aDistance );
51static float distanceFromPointToLine( const VECTOR2D& aPoint, const VECTOR2D& aLineStart,
52 const VECTOR2D& aLineEnd );
53
54
55bool SVG_IMPORT_PLUGIN::Load( const wxString& aFileName )
56{
57 wxCHECK( m_importer, false );
58
59 LOCALE_IO toggle; // switch on/off the locale "C" notation
60
61 // 1- wxFopen takes care of unicode filenames across platforms
62 // 2 - nanosvg (exactly nsvgParseFromFile) expects a binary file (exactly the CRLF eof must
63 // not be replaced by LF and changes the byte count) in one validity test,
64 // so open it in binary mode.
65 FILE* fp = wxFopen( aFileName, wxT( "rb" ) );
66
67 if( fp == nullptr )
68 return false;
69
70 // nsvgParseFromFile will close the file after reading
71 m_parsedImage = nsvgParseFromFile( fp, "mm", SVG_DPI );
72
73 wxCHECK( m_parsedImage, false );
74
75 return true;
76}
77
78
79bool SVG_IMPORT_PLUGIN::LoadFromMemory( const wxMemoryBuffer& aMemBuffer )
80{
81 wxCHECK( m_importer, false );
82
83 LOCALE_IO toggle; // switch on/off the locale "C" notation
84
85 std::string str( reinterpret_cast<char*>( aMemBuffer.GetData() ), aMemBuffer.GetDataLen() );
86 wxCHECK( str.data()[aMemBuffer.GetDataLen()] == '\0', false );
87
88 // nsvgParse will modify the string data
89 m_parsedImage = nsvgParse( str.data(), "mm", SVG_DPI );
90
91 wxCHECK( m_parsedImage, false );
92
93 return true;
94}
95
96
98{
99 auto alpha =
100 []( unsigned int color )
101 {
102 return color >> 24;
103 };
104
105 for( NSVGshape* shape = m_parsedImage->shapes; shape != nullptr; shape = shape->next )
106 {
107 if( !( shape->flags & NSVG_FLAGS_VISIBLE ) )
108 continue;
109
110 if( shape->stroke.type == NSVG_PAINT_NONE && shape->fill.type == NSVG_PAINT_NONE )
111 continue;
112
113 double lineWidth = shape->stroke.type != NSVG_PAINT_NONE ? shape->strokeWidth : -1;
114 bool filled = shape->fill.type != NSVG_PAINT_NONE && alpha( shape->fill.color ) > 0;
115
116 COLOR4D fillColor = COLOR4D::UNSPECIFIED;
117
118 if( shape->fill.type == NSVG_PAINT_COLOR )
119 {
120 unsigned int icolor = shape->fill.color;
121
122 fillColor.r = std::clamp( ( icolor >> 0 ) & 0xFF, 0u, 255u ) / 255.0;
123 fillColor.g = std::clamp( ( icolor >> 8 ) & 0xFF, 0u, 255u ) / 255.0;
124 fillColor.b = std::clamp( ( icolor >> 16 ) & 0xFF, 0u, 255u ) / 255.0;
125 fillColor.a = std::clamp( ( icolor >> 24 ) & 0xFF, 0u, 255u ) / 255.0;
126
127 // nanosvg probably didn't read it properly, use default
128 if( fillColor == COLOR4D::BLACK )
129 fillColor = COLOR4D::UNSPECIFIED;
130 }
131
132 COLOR4D strokeColor = COLOR4D::UNSPECIFIED;
133
134 if( shape->stroke.type == NSVG_PAINT_COLOR )
135 {
136 unsigned int icolor = shape->stroke.color;
137
138 strokeColor.r = std::clamp( ( icolor >> 0 ) & 0xFF, 0u, 255u ) / 255.0;
139 strokeColor.g = std::clamp( ( icolor >> 8 ) & 0xFF, 0u, 255u ) / 255.0;
140 strokeColor.b = std::clamp( ( icolor >> 16 ) & 0xFF, 0u, 255u ) / 255.0;
141 strokeColor.a = std::clamp( ( icolor >> 24 ) & 0xFF, 0u, 255u ) / 255.0;
142
143 // nanosvg probably didn't read it properly, use default
144 if( strokeColor == COLOR4D::BLACK )
145 strokeColor = COLOR4D::UNSPECIFIED;
146 }
147
148 LINE_STYLE dashType = LINE_STYLE::SOLID;
149
150 if( shape->strokeDashCount > 0 )
151 {
152 float* dashArray = shape->strokeDashArray;
153
154 int dotCount = 0;
155 int dashCount = 0;
156
157 const float dashThreshold = shape->strokeWidth * 1.9f;
158
159 for( int i = 0; i < shape->strokeDashCount; i += 2 )
160 {
161 if( dashArray[i] < dashThreshold )
162 dotCount++;
163 else
164 dashCount++;
165 }
166
167 if( dotCount > 0 && dashCount == 0 )
168 dashType = LINE_STYLE::DOT;
169 else if( dotCount == 0 && dashCount > 0 )
170 dashType = LINE_STYLE::DASH;
171 else if( dotCount == 1 && dashCount == 1 )
172 dashType = LINE_STYLE::DASHDOT;
173 else if( dotCount == 2 && dashCount == 1 )
174 dashType = LINE_STYLE::DASHDOTDOT;
175 }
176
177 IMPORTED_STROKE stroke( lineWidth, dashType, strokeColor );
178
180
181 switch( shape->fillRule )
182 {
183 case NSVG_FILLRULE_NONZERO: rule = GRAPHICS_IMPORTER::PF_NONZERO; break;
184 case NSVG_FILLRULE_EVENODD: rule = GRAPHICS_IMPORTER::PF_EVEN_ODD; break;
185 default: break;
186 }
187
189
190 for( NSVGpath* path = shape->paths; path != nullptr; path = path->next )
191 {
192 if( filled && !path->closed )
193 {
194 // KiCad doesn't support a single object representing a filled shape that is
195 // *not* closed so create a filled, closed shape for the fill, and an unfilled,
196 // open shape for the outline
197 static IMPORTED_STROKE noStroke( -1, LINE_STYLE::SOLID, COLOR4D::UNSPECIFIED );
198 const bool closed = true;
199
200 DrawPath( path->pts, path->npts, closed, noStroke, true, fillColor );
201
202 if( stroke.GetWidth() > 0 )
203 DrawPath( path->pts, path->npts, !closed, stroke, false, COLOR4D::UNSPECIFIED );
204 }
205 else
206 {
207 // Either the shape has fill and no stroke, so we implicitly close it (for no
208 // difference), or it's really closed.
209 // We could choose to import a not-filled, closed outline as splines to keep the
210 // original editability and control points, but currently we don't.
211 const bool closed = path->closed || filled;
212
213 DrawPath( path->pts, path->npts, closed, stroke, filled, fillColor );
214 }
215 }
216 }
217
219 wxCHECK( m_importer, false );
221
222 return true;
223}
224
225
227{
228 if( !m_parsedImage )
229 {
230 wxASSERT_MSG( false, wxT( "Image must have been loaded before checking height" ) );
231 return 0.0;
232 }
233
234 return m_parsedImage->height / SVG_DPI * inches2mm;
235}
236
237
239{
240 if( !m_parsedImage )
241 {
242 wxASSERT_MSG( false, wxT( "Image must have been loaded before checking width" ) );
243 return 0.0;
244 }
245
246 return m_parsedImage->width / SVG_DPI * inches2mm;
247}
248
249
251{
252 BOX2D bbox;
253
254 if( !m_parsedImage || !m_parsedImage->shapes )
255 {
256 wxASSERT_MSG( false, wxT( "Image must have been loaded before getting bbox" ) );
257 return bbox;
258 }
259
260 for( NSVGshape* shape = m_parsedImage->shapes; shape != nullptr; shape = shape->next )
261 {
262 BOX2D shapeBbox;
263 float( &bounds )[4] = shape->bounds;
264
265 shapeBbox.SetOrigin( bounds[0], bounds[1] );
266 shapeBbox.SetEnd( bounds[2], bounds[3] );
267
268 bbox.Merge( shapeBbox );
269 }
270
271 return bbox;
272}
273
274
275static void GatherInterpolatedCubicBezierCurve( const float* aPoints,
276 std::vector<VECTOR2D>& aGeneratedPoints )
277{
278 auto start = getBezierPoint( aPoints, 0.0f );
279 auto end = getBezierPoint( aPoints, 1.0f );
280 auto segmentationThreshold = calculateBezierSegmentationThreshold( aPoints );
281
282 if( aGeneratedPoints.size() == 0 || aGeneratedPoints.back() != start )
283 aGeneratedPoints.push_back( start );
284
285 segmentBezierCurve( start, end, 0.0f, 0.5f, aPoints, segmentationThreshold, aGeneratedPoints );
286 aGeneratedPoints.push_back( end );
287}
288
289
290static void GatherInterpolatedCubicBezierPath( const float* aPoints, int aNumPoints,
291 std::vector<VECTOR2D>& aGeneratedPoints )
292{
293 const int pointsPerSegment = 4;
294 const int curveSpecificPointsPerSegment = 3;
295 const int curveSpecificCoordinatesPerSegment = 2 * curveSpecificPointsPerSegment;
296 const float* currentPoints = aPoints;
297 int remainingPoints = aNumPoints;
298
299 while( remainingPoints >= pointsPerSegment )
300 {
301 GatherInterpolatedCubicBezierCurve( currentPoints, aGeneratedPoints );
302 currentPoints += curveSpecificCoordinatesPerSegment;
303 remainingPoints -= curveSpecificPointsPerSegment;
304 }
305}
306
307
308void SVG_IMPORT_PLUGIN::DrawPath( const float* aPoints, int aNumPoints, bool aClosedPath,
309 const IMPORTED_STROKE& aStroke, bool aFilled,
310 const COLOR4D& aFillColor )
311{
312 bool drewPolygon = false;
313
314 if( aClosedPath )
315 {
316 // Closed paths are always polygons, which mean they need to be interpolated
317 std::vector<VECTOR2D> collectedPathPoints;
318
319 if( aNumPoints > 0 )
320 GatherInterpolatedCubicBezierPath( aPoints, aNumPoints, collectedPathPoints );
321
322 if( collectedPathPoints.size() > 2 )
323 {
324 DrawPolygon( collectedPathPoints, aStroke, aFilled, aFillColor );
325 drewPolygon = true;
326 }
327 }
328
329 if( !drewPolygon )
330 {
331 DrawSplinePath( aPoints, aNumPoints, aStroke );
332 }
333}
334
335
336void SVG_IMPORT_PLUGIN::DrawSplinePath( const float* aCoords, int aNumPoints,
337 const IMPORTED_STROKE& aStroke )
338{
339 // NanoSVG just gives us the points of the Bezier curves, so we have to
340 // decide whether to draw lines or splines based on the points we have.
341
342 const int pointsPerSegment = 4;
343 const int curveSpecificPointsPerSegment = 3;
344 const int curveSpecificCoordinatesPerSegment = 2 * curveSpecificPointsPerSegment;
345 const float* currentCoords = aCoords;
346 int remainingPoints = aNumPoints;
347
348 while( remainingPoints >= pointsPerSegment )
349 {
350 VECTOR2D start = getPoint( currentCoords );
351 VECTOR2D c1 = getPoint( currentCoords + 2 );
352 VECTOR2D c2 = getPoint( currentCoords + 4 );
353 VECTOR2D end = getPoint( currentCoords + 6 );
354
355 // Add as a spline and the importer will decide whether to draw it as a spline or as lines
356 m_internalImporter.AddSpline( start, c1, c2, end, aStroke );
357
358 currentCoords += curveSpecificCoordinatesPerSegment;
359 remainingPoints -= curveSpecificPointsPerSegment;
360 }
361}
362
363
364void SVG_IMPORT_PLUGIN::DrawPolygon( const std::vector<VECTOR2D>& aPoints,
365 const IMPORTED_STROKE& aStroke, bool aFilled,
366 const COLOR4D& aFillColor )
367{
368 m_internalImporter.AddPolygon( aPoints, aStroke, aFilled, aFillColor );
369}
370
371
372void SVG_IMPORT_PLUGIN::DrawLineSegments( const std::vector<VECTOR2D>& aPoints,
373 const IMPORTED_STROKE& aStroke )
374{
375 unsigned int numLineStartPoints = aPoints.size() - 1;
376
377 for( unsigned int pointIndex = 0; pointIndex < numLineStartPoints; ++pointIndex )
378 m_internalImporter.AddLine( aPoints[pointIndex], aPoints[pointIndex + 1], aStroke );
379}
380
381
382static VECTOR2D getPoint( const float* aPointCoordinates )
383{
384 return VECTOR2D( aPointCoordinates[0], aPointCoordinates[1] );
385}
386
387
388static VECTOR2D getBezierPoint( const float* aPoints, float aStep )
389{
390 const int coordinatesPerPoint = 2;
391
392 auto firstCubicPoint = getPoint( aPoints );
393 auto secondCubicPoint = getPoint( aPoints + 1 * coordinatesPerPoint );
394 auto thirdCubicPoint = getPoint( aPoints + 2 * coordinatesPerPoint );
395 auto fourthCubicPoint = getPoint( aPoints + 3 * coordinatesPerPoint );
396
397 auto firstQuadraticPoint = getPointInLine( firstCubicPoint, secondCubicPoint, aStep );
398 auto secondQuadraticPoint = getPointInLine( secondCubicPoint, thirdCubicPoint, aStep );
399 auto thirdQuadraticPoint = getPointInLine( thirdCubicPoint, fourthCubicPoint, aStep );
400
401 auto firstLinearPoint = getPointInLine( firstQuadraticPoint, secondQuadraticPoint, aStep );
402 auto secondLinearPoint = getPointInLine( secondQuadraticPoint, thirdQuadraticPoint, aStep );
403
404 return getPointInLine( firstLinearPoint, secondLinearPoint, aStep );
405}
406
407
408static VECTOR2D getPointInLine( const VECTOR2D& aLineStart, const VECTOR2D& aLineEnd,
409 float aDistance )
410{
411 return aLineStart + ( aLineEnd - aLineStart ) * aDistance;
412}
413
414
415static float calculateBezierSegmentationThreshold( const float* aCurvePoints )
416{
417 using comparatorFunction = const float&(*)( const float&, const float& );
418
419 auto minimumComparator = static_cast< comparatorFunction >( &std::min );
420 auto maximumComparator = static_cast< comparatorFunction >( &std::max );
421
422 VECTOR2D minimum = calculateBezierBoundingBoxExtremity( aCurvePoints, minimumComparator );
423 VECTOR2D maximum = calculateBezierBoundingBoxExtremity( aCurvePoints, maximumComparator );
424 VECTOR2D boundingBoxDimensions = maximum - minimum;
425
426 return 0.001 * std::max( boundingBoxDimensions.x, boundingBoxDimensions.y );
427}
428
429
430static VECTOR2D calculateBezierBoundingBoxExtremity( const float* aCurvePoints,
431 std::function< const float&( const float&, const float& ) > comparator )
432{
433 float x = aCurvePoints[0];
434 float y = aCurvePoints[1];
435
436 for( int pointIndex = 1; pointIndex < 3; ++pointIndex )
437 {
438 x = comparator( x, aCurvePoints[ 2 * pointIndex ] );
439 y = comparator( y, aCurvePoints[ 2 * pointIndex + 1 ] );
440 }
441
442 return VECTOR2D( x, y );
443}
444
445
446static void segmentBezierCurve( const VECTOR2D& aStart, const VECTOR2D& aEnd, float aOffset,
447 float aStep, const float* aCurvePoints,
448 float aSegmentationThreshold,
449 std::vector< VECTOR2D >& aGeneratedPoints )
450{
451 VECTOR2D middle = getBezierPoint( aCurvePoints, aOffset + aStep );
452 float distanceToPreviousSegment = distanceFromPointToLine( middle, aStart, aEnd );
453
454 if( distanceToPreviousSegment > aSegmentationThreshold )
455 {
456 createNewBezierCurveSegments( aStart, middle, aEnd, aOffset, aStep, aCurvePoints,
457 aSegmentationThreshold, aGeneratedPoints );
458 }
459}
460
461
462static void createNewBezierCurveSegments( const VECTOR2D& aStart, const VECTOR2D& aMiddle,
463 const VECTOR2D& aEnd, float aOffset, float aStep,
464 const float* aCurvePoints, float aSegmentationThreshold,
465 std::vector< VECTOR2D >& aGeneratedPoints )
466{
467 float newStep = aStep / 2.f;
468 float offsetAfterMiddle = aOffset + aStep;
469
470 segmentBezierCurve( aStart, aMiddle, aOffset, newStep, aCurvePoints, aSegmentationThreshold,
471 aGeneratedPoints );
472
473 aGeneratedPoints.push_back( aMiddle );
474
475 segmentBezierCurve( aMiddle, aEnd, offsetAfterMiddle, newStep, aCurvePoints,
476 aSegmentationThreshold, aGeneratedPoints );
477}
478
479
480static float distanceFromPointToLine( const VECTOR2D& aPoint, const VECTOR2D& aLineStart,
481 const VECTOR2D& aLineEnd )
482{
483 auto lineDirection = aLineEnd - aLineStart;
484 auto lineNormal = lineDirection.Perpendicular().Resize( 1.f );
485 auto lineStartToPoint = aPoint - aLineStart;
486
487 auto distance = lineNormal.Dot( lineStartToPoint );
488
489 return fabs( distance );
490}
491
492
493void SVG_IMPORT_PLUGIN::ReportMsg( const wxString& aMessage )
494{
495 // Add message to keep trace of not handled svg entities
496 m_messages += aMessage;
497 m_messages += '\n';
498}
int color
Definition: DXF_plotter.cpp:60
constexpr void SetOrigin(const Vec &pos)
Definition: box2.h:237
constexpr BOX2< Vec > & Merge(const BOX2< Vec > &aRect)
Modify the position and size of the rectangle in order to contain aRect.
Definition: box2.h:658
constexpr void SetEnd(coord_type x, coord_type y)
Definition: box2.h:297
void AddSpline(const VECTOR2D &aStart, const VECTOR2D &aBezierControl1, const VECTOR2D &aBezierControl2, const VECTOR2D &aEnd, const IMPORTED_STROKE &aStroke) override
Create an object representing an arc.
void AddLine(const VECTOR2D &aStart, const VECTOR2D &aEnd, const IMPORTED_STROKE &aStroke) override
Create an object representing a line segment.
void ImportTo(GRAPHICS_IMPORTER &aImporter)
void AddPolygon(const std::vector< VECTOR2D > &aVertices, const IMPORTED_STROKE &aStroke, bool aFilled, const COLOR4D &aFillColor=COLOR4D::UNSPECIFIED) override
Create an object representing a polygon.
virtual void NewShape(POLY_FILL_RULE aFillRule=PF_NONZERO)
GRAPHICS_IMPORTER * m_importer
Importer used to create objects representing the imported shapes.
A clone of IMPORTED_STROKE, but with floating-point width.
double GetWidth() const
A color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:104
double r
Red component.
Definition: color4d.h:392
double g
Green component.
Definition: color4d.h:393
double a
Alpha component.
Definition: color4d.h:395
double b
Blue component.
Definition: color4d.h:394
Instantiate the current locale within a scope in which you are expecting exceptions to be thrown.
Definition: locale_io.h:49
void DrawPolygon(const std::vector< VECTOR2D > &aPoints, const IMPORTED_STROKE &aStroke, bool aFilled, const COLOR4D &aFillColor)
virtual BOX2D GetImageBBox() const override
Return image bounding box from original imported file.
GRAPHICS_IMPORTER_BUFFER m_internalImporter
struct NSVGimage * m_parsedImage
void DrawLineSegments(const std::vector< VECTOR2D > &aPoints, const IMPORTED_STROKE &aStroke)
bool Import() override
Actually imports the file.
virtual double GetImageWidth() const override
Return image width from original imported file.
bool LoadFromMemory(const wxMemoryBuffer &aMemBuffer) override
Set memory buffer with content for import.
bool Load(const wxString &aFileName) override
Load file for import.
virtual double GetImageHeight() const override
Return image height from original imported file.
void DrawSplinePath(const float *aPoints, int aNumPoints, const IMPORTED_STROKE &aStroke)
Draw a path made up of cubic Bezier curves, adding them as real bezier curves.
void DrawPath(const float *aPoints, int aNumPoints, bool aClosedPath, const IMPORTED_STROKE &aStroke, bool aFilled, const COLOR4D &aFillColor)
void ReportMsg(const wxString &aMessage) override
constexpr VECTOR2< T > Perpendicular() const
Compute the perpendicular vector.
Definition: vector2d.h:314
VECTOR2< T > Resize(T aNewLength) const
Return a vector of the same direction, but length specified in aNewLength.
Definition: vector2d.h:385
static float distance(const SFVEC2UI &a, const SFVEC2UI &b)
LINE_STYLE
Dashed line types.
Definition: stroke_params.h:46
static void segmentBezierCurve(const VECTOR2D &aStart, const VECTOR2D &aEnd, float aOffset, float aStep, const float *aCurvePoints, float aSegmentationThreshold, std::vector< VECTOR2D > &aGeneratedPoints)
static float distanceFromPointToLine(const VECTOR2D &aPoint, const VECTOR2D &aLineStart, const VECTOR2D &aLineEnd)
static const int SVG_DPI
static VECTOR2D getPointInLine(const VECTOR2D &aLineStart, const VECTOR2D &aLineEnd, float aDistance)
static VECTOR2D getBezierPoint(const float *aCurvePoints, float aStep)
static VECTOR2D calculateBezierBoundingBoxExtremity(const float *aCurvePoints, std::function< const float &(const float &, const float &) > comparator)
static void GatherInterpolatedCubicBezierCurve(const float *aPoints, std::vector< VECTOR2D > &aGeneratedPoints)
static void createNewBezierCurveSegments(const VECTOR2D &aStart, const VECTOR2D &aMiddle, const VECTOR2D &aEnd, float aOffset, float aStep, const float *aCurvePoints, float aSegmentationThreshold, std::vector< VECTOR2D > &aGeneratedPoints)
static VECTOR2D getPoint(const float *aPointCoordinates)
static float calculateBezierSegmentationThreshold(const float *aCurvePoints)
static void GatherInterpolatedCubicBezierPath(const float *aPoints, int aNumPoints, std::vector< VECTOR2D > &aGeneratedPoints)
VECTOR2I end
VECTOR2< double > VECTOR2D
Definition: vector2d.h:694