Skip to content

Commit cd32769

Browse files
committed
method bufferedGetStepLine
1 parent b02e046 commit cd32769

File tree

8 files changed

+193
-235
lines changed

8 files changed

+193
-235
lines changed

IfcPlusPlus/src/ifcpp/geometry/ConverterOSG.h

+3
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OU
2828
#include <ifcpp/model/BasicTypes.h>
2929
#include <ifcpp/model/OpenMPIncludes.h>
3030
#include <ifcpp/model/StatusCallback.h>
31+
#include <ifcpp/IFC4X3/EntityFactory.h>
3132
#include <ifcpp/IFC4X3/include/IfcCurtainWall.h>
3233
#include <ifcpp/IFC4X3/include/IfcFeatureElementSubtraction.h>
3334
#include <ifcpp/IFC4X3/include/IfcGloballyUniqueId.h>
@@ -44,6 +45,8 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OU
4445
#include "IncludeCarveHeaders.h"
4546
#include "CSG_Adapter.h"
4647

48+
using namespace IFC4X3;
49+
4750
class ConverterOSG : public StatusCallback
4851
{
4952
protected:

IfcPlusPlus/src/ifcpp/geometry/GeomDebugDump.h

+42-11
Original file line numberDiff line numberDiff line change
@@ -407,19 +407,25 @@ namespace GeomDebugDump
407407
if( meshset->meshes[0]->faces.size() > 0 )
408408
{
409409
carve::mesh::Face<3>* f = meshset->meshes[0]->faces[0];
410-
const carve::mesh::Vertex<3>* v1 = f->edge->v1();
411-
const carve::mesh::Vertex<3>* v2 = f->edge->v2();
412-
413-
int v1index = findVertexIndexInVector(vec_vertices, v1);
414-
if( v1index < 0 )
410+
if( f != nullptr )
415411
{
416-
std::cout << "vertex not found\n";
417-
}
412+
if( f->edge != nullptr )
413+
{
414+
const carve::mesh::Vertex<3>* v1 = f->edge->v1();
415+
const carve::mesh::Vertex<3>* v2 = f->edge->v2();
418416

419-
int v2index = findVertexIndexInVector(vec_vertices, v2);
420-
if( v2index < 0 )
421-
{
422-
std::cout << "vertex not found\n";
417+
int v1index = findVertexIndexInVector(vec_vertices, v1);
418+
if( v1index < 0 )
419+
{
420+
std::cout << "vertex not found\n";
421+
}
422+
423+
int v2index = findVertexIndexInVector(vec_vertices, v2);
424+
if( v2index < 0 )
425+
{
426+
std::cout << "vertex not found\n";
427+
}
428+
}
423429
}
424430
}
425431
}
@@ -944,12 +950,37 @@ namespace GeomDebugDump
944950

945951
for( auto mesh : meshset->meshes )
946952
{
953+
bool pointersOk = true;
954+
for( auto f : mesh->faces )
955+
{
956+
if( f == nullptr )
957+
{
958+
pointersOk = false;
959+
break;
960+
}
961+
if( f->edge == nullptr )
962+
{
963+
pointersOk = false;
964+
break;
965+
}
966+
}
967+
968+
if( !pointersOk )
969+
{
970+
continue;
971+
}
972+
947973
mesh->cacheEdges();
974+
948975
std::vector<carve::mesh::Edge<3>* > openEdges = mesh->open_edges;
949976
numOpenEdges += openEdges.size();
950977
for( size_t ii = 0; ii < openEdges.size(); ++ii )
951978
{
952979
auto e = openEdges[ii];
980+
if( e->vert == nullptr )
981+
{
982+
continue;
983+
}
953984
auto p1 = e->v1()->v;
954985
auto p2 = e->v2()->v;
955986

IfcPlusPlus/src/ifcpp/geometry/GeomUtils.h

+17-17
Original file line numberDiff line numberDiff line change
@@ -1085,28 +1085,28 @@ namespace GeomUtils
10851085
return false;
10861086
}
10871087

1088-
inline bool isMatrixIdentity( const carve::math::Matrix& mat )
1088+
inline bool isMatrixIdentity( const carve::math::Matrix& mat, double eps = 0.00001 )
10891089
{
1090-
if( std::abs( mat._11 - 1.0 ) > 0.00001 ) return false;
1091-
if( std::abs( mat._22 - 1.0 ) > 0.00001 ) return false;
1092-
if( std::abs( mat._33 - 1.0 ) > 0.00001 ) return false;
1093-
if( std::abs( mat._44 - 1.0 ) > 0.00001 ) return false;
1090+
if( std::abs( mat._11 - 1.0 ) > eps ) return false;
1091+
if( std::abs( mat._22 - 1.0 ) > eps ) return false;
1092+
if( std::abs( mat._33 - 1.0 ) > eps ) return false;
1093+
if( std::abs( mat._44 - 1.0 ) > eps ) return false;
10941094

1095-
if( std::abs( mat._12 ) > 0.00001 ) return false;
1096-
if( std::abs( mat._13 ) > 0.00001 ) return false;
1097-
if( std::abs( mat._14 ) > 0.00001 ) return false;
1095+
if( std::abs( mat._12 ) > eps ) return false;
1096+
if( std::abs( mat._13 ) > eps ) return false;
1097+
if( std::abs( mat._14 ) > eps ) return false;
10981098

1099-
if( std::abs( mat._21 ) > 0.00001 ) return false;
1100-
if( std::abs( mat._23 ) > 0.00001 ) return false;
1101-
if( std::abs( mat._24 ) > 0.00001 ) return false;
1099+
if( std::abs( mat._21 ) > eps ) return false;
1100+
if( std::abs( mat._23 ) > eps ) return false;
1101+
if( std::abs( mat._24 ) > eps ) return false;
11021102

1103-
if( std::abs( mat._31 ) > 0.00001 ) return false;
1104-
if( std::abs( mat._32 ) > 0.00001 ) return false;
1105-
if( std::abs( mat._34 ) > 0.00001 ) return false;
1103+
if( std::abs( mat._31 ) > eps ) return false;
1104+
if( std::abs( mat._32 ) > eps ) return false;
1105+
if( std::abs( mat._34 ) > eps ) return false;
11061106

1107-
if( std::abs( mat._41 ) > 0.00001 ) return false;
1108-
if( std::abs( mat._42 ) > 0.00001 ) return false;
1109-
if( std::abs( mat._43 ) > 0.00001 ) return false;
1107+
if( std::abs( mat._41 ) > eps ) return false;
1108+
if( std::abs( mat._42 ) > eps ) return false;
1109+
if( std::abs( mat._43 ) > eps ) return false;
11101110
return true;
11111111
}
11121112
inline bool isMatrixEqual(const carve::math::Matrix& mat1, const carve::math::Matrix& mat2, double maxDelta = 0.00001)

IfcPlusPlus/src/ifcpp/geometry/MeshOpsDebug.h

+9
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,15 @@ inline void dumpMeshset(const shared_ptr<carve::mesh::MeshSet<3> >& meshset, con
136136
{
137137
return;
138138
}
139+
140+
bool checkForDegenerateEdges = false;
141+
MeshSetInfo info;
142+
MeshUtils::checkMeshSetPointers(meshset, checkForDegenerateEdges, info);
143+
if( !info.allPointersValid )
144+
{
145+
return;
146+
}
147+
139148
vec3 offset = carve::geom::VECTOR(0, GeomDebugDump::dump_y_pos_geom, 0);
140149
shared_ptr<carve::mesh::MeshSet<3> > meshset_copy(meshset->clone());
141150
double eps = EPS_M8;

IfcPlusPlus/src/ifcpp/geometry/PointConverter.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -413,14 +413,14 @@ class PointConverter : public StatusCallback
413413
x2=x3;
414414
}
415415

416-
if( resultAngle < 0 )
416+
if( resultAngle < -2.0*M_PI )
417417
{
418-
resultAngle += 2.0 * M_PI;
418+
resultAngle = -2.0 * M_PI;
419419
}
420420

421421
if( resultAngle > 2.0*M_PI )
422422
{
423-
resultAngle -= 2.0 * M_PI;
423+
resultAngle = 2.0 * M_PI;
424424
}
425425
return resultAngle;
426426
}

0 commit comments

Comments
 (0)