mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-06 07:51:47 +00:00
#1287 Don't wel accross different rep items
This commit is contained in:
@@ -117,6 +117,7 @@ namespace IfcGeom {
|
||||
std::vector<P> uvs_;
|
||||
std::vector<int> _material_ids;
|
||||
std::vector<Material> _materials;
|
||||
size_t weld_offset_;
|
||||
VertexKeyMap welds;
|
||||
|
||||
public:
|
||||
@@ -130,10 +131,15 @@ namespace IfcGeom {
|
||||
const std::vector<Material>& materials() const { return _materials; }
|
||||
|
||||
Triangulation(const BRep& shape_model)
|
||||
: Representation(shape_model.settings())
|
||||
, id_(shape_model.id())
|
||||
: Representation(shape_model.settings())
|
||||
, id_(shape_model.id())
|
||||
, weld_offset_(0)
|
||||
{
|
||||
for ( IfcGeom::IfcRepresentationShapeItems::const_iterator iit = shape_model.begin(); iit != shape_model.end(); ++ iit ) {
|
||||
|
||||
// Don't weld vertices that belong to different items to prevent non-manifold situations.
|
||||
weld_offset_ += welds.size();
|
||||
welds.clear();
|
||||
|
||||
int surface_style_id = -1;
|
||||
if (iit->hasStyle()) {
|
||||
@@ -386,7 +392,7 @@ namespace IfcGeom {
|
||||
const VertexKey key = std::make_pair(material_index, std::make_pair(X, std::make_pair(Y, Z)));
|
||||
typename VertexKeyMap::const_iterator it = welds.find(key);
|
||||
if ( it != welds.end() ) return it->second;
|
||||
i = (int) welds.size();
|
||||
i = (int) welds.size() + weld_offset_;
|
||||
welds[key] = i;
|
||||
}
|
||||
_verts.push_back(X);
|
||||
|
||||
Reference in New Issue
Block a user