Merge branch 'visitortests' of https://github.com/openscad/openscad into visitortests

stl_dim
Marius Kintel 2011-10-27 15:35:10 +02:00
commit 16042907c3
4 changed files with 2 additions and 4 deletions

View File

@ -181,6 +181,7 @@ cant_project_non_simple_polyhedron:
static void add_slice(PolySet *ps, const DxfData &dxf, DxfData::Path &path, double rot1, double rot2, double h1, double h2)
{
bool splitfirst = sin(rot2 - rot1) >= 0.0;
for (size_t j = 1; j < path.indices.size(); j++)
{
int k = j - 1;
@ -197,10 +198,7 @@ static void add_slice(PolySet *ps, const DxfData &dxf, DxfData::Path &path, doub
double kx2 = dxf.points[path.indices[k]][0] * cos(rot2*M_PI/180) + dxf.points[path.indices[k]][1] * sin(rot2*M_PI/180);
double ky2 = dxf.points[path.indices[k]][0] * -sin(rot2*M_PI/180) + dxf.points[path.indices[k]][1] * cos(rot2*M_PI/180);
double dia1_len_sq = (jy1-ky2)*(jy1-ky2) + (jx1-kx2)*(jx1-kx2);
double dia2_len_sq = (jy2-ky1)*(jy2-ky1) + (jx2-kx1)*(jx2-kx1);
if (dia1_len_sq > dia2_len_sq)
if (splitfirst)
{
ps->append_poly();
if (path.is_inner) {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.4 KiB

After

Width:  |  Height:  |  Size: 12 KiB