#include <algorithm>
#include <cerrno>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <string>
#include <vector>
#include <convert_to_biu.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 544 of file bitmap2component.cpp.
549{
550 double dd0, dd1, dd,
delta, e2, epsilon, t;
551
552
553
554
555
556
557
558
560
561
562
563 dd0 =
square( p1.x - 2 * p2.x + p3.x ) +
square( p1.y - 2 * p2.y + p3.y );
564 dd1 =
square( p2.x - 2 * p3.x + p4.x ) +
square( p2.y - 2 * p3.y + p4.y );
565 dd = 6 * sqrt( std::max( dd0, dd1 ) );
567 epsilon = sqrt( e2 );
568
569 for( t = epsilon; t<1; t += epsilon )
570 {
571 potrace_dpoint_t intermediate_point;
572 intermediate_point.x = p1.x *
cube( 1 - t ) +
573 3* p2.x*
square( 1 - t ) * t +
574 3 * p3.x * (1 - t) *
square( t ) +
576
577 intermediate_point.y = p1.y *
cube( 1 - t ) +
578 3* p2.y*
square( 1 - t ) * t +
579 3 * p3.y * (1 - t) *
square( t ) + p4.y*
cube( t );
580
581 aCornersBuffer.push_back( intermediate_point );
582 }
583
584 aCornersBuffer.push_back( p4 );
585}
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 |