#include <algorithm>
#include <cerrno>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <string>
#include <vector>
#include <kiid.h>
#include <layer_ids.h>
#include <locale_io.h>
#include <potracelib.h>
#include "bitmap2component.h"
Go to the source code of this file.
|
static void | bm_free (potrace_bitmap_t *bm) |
|
static void | BezierToPolyline (std::vector< potrace_dpoint_t > &aCornersBuffer, potrace_dpoint_t p1, potrace_dpoint_t p2, potrace_dpoint_t p3, potrace_dpoint_t p4) |
|
double | square (double x) |
|
double | cube (double x) |
|
◆ SCH_LINE_THICKNESS_MM
#define SCH_LINE_THICKNESS_MM 0.01 |
◆ BezierToPolyline()
void BezierToPolyline |
( |
std::vector< potrace_dpoint_t > & |
aCornersBuffer, |
|
|
potrace_dpoint_t |
p1, |
|
|
potrace_dpoint_t |
p2, |
|
|
potrace_dpoint_t |
p3, |
|
|
potrace_dpoint_t |
p4 |
|
) |
| |
|
static |
Definition at line 561 of file bitmap2component.cpp.
566{
567 double dd0, dd1, dd,
delta, e2, epsilon, t;
568
569
570
571
572
573
574
575
577
578
579
580 dd0 =
square( p1.x - 2 * p2.x + p3.x ) +
square( p1.y - 2 * p2.y + p3.y );
581 dd1 =
square( p2.x - 2 * p3.x + p4.x ) +
square( p2.y - 2 * p3.y + p4.y );
582 dd = 6 * sqrt( std::max( dd0, dd1 ) );
584 epsilon = sqrt( e2 );
585
586 for( t = epsilon; t<1; t += epsilon )
587 {
588 potrace_dpoint_t intermediate_point;
589 intermediate_point.x = p1.x *
cube( 1 - t ) +
590 3* p2.x*
square( 1 - t ) * t +
591 3 * p3.x * (1 - t) *
square( t ) +
593
594 intermediate_point.y = p1.y *
cube( 1 - t ) +
595 3* p2.y*
square( 1 - t ) * t +
596 3 * p3.y * (1 - t) *
square( t ) + p4.y*
cube( t );
597
598 aCornersBuffer.push_back( intermediate_point );
599 }
600
601 aCornersBuffer.push_back( p4 );
602}
References cube(), delta, and square().
Referenced by BITMAPCONV_INFO::createOutputData().
◆ bm_free()
static void bm_free |
( |
potrace_bitmap_t * |
bm | ) |
|
|
static |
◆ cube()
◆ square()
double square |
( |
double |
x | ) |
|
|
inline |