mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-11 18:16:40 +00:00
Merge branch 'cgal' of https://github.com/tudelft3d/IfcOpenShell into cgal
This commit is contained in:
@@ -834,14 +834,12 @@ bool CgalKernel::process_extrusion(const cgal_face_t& bottom_face, const taxonom
|
||||
// Mark as internal before erasure in external
|
||||
// This is {i,j} at the time the edge use was inserted.
|
||||
internal_edges.insert(p.first->second);
|
||||
|
||||
// not inserted, remove
|
||||
external_edges.erase(p.first);
|
||||
|
||||
// @nb note the difference here in indices, {i0, i1} is point indices in
|
||||
// point_map. i is index in faces_to_extrude, j is segment index in wire.
|
||||
internal_edges.insert({ i, j });
|
||||
|
||||
}
|
||||
}
|
||||
i++;
|
||||
@@ -1080,6 +1078,8 @@ CGAL::Polyhedron_3<Kernel_> ifcopenshell::geometry::utils::create_cube(const Ker
|
||||
bool CgalKernel::thin_solid(const CGAL::Nef_polyhedron_3<Kernel_>& a, CGAL::Nef_polyhedron_3<Kernel_>& result) {
|
||||
// @todo this should be possible as a minkowski sum of facet & cube. rather than a set of boolean ops.
|
||||
|
||||
auto precision_cube_ = precision_cube();
|
||||
|
||||
auto a_nonconst = a;
|
||||
auto ax = CGAL::minkowski_sum_3(a_nonconst, precision_cube_);
|
||||
auto x = ax - a;
|
||||
@@ -1137,6 +1137,8 @@ bool CgalKernel::preprocess_boolean_operand(const IfcUtil::IfcBaseClass* log_ref
|
||||
return false;
|
||||
}
|
||||
|
||||
auto precision_cube_ = precision_cube();
|
||||
|
||||
if (dilate) {
|
||||
try {
|
||||
// @todo don't dilate in 3 dimensions but only in the XY plane, orthogonal to wall axis.
|
||||
|
||||
@@ -70,10 +70,15 @@ namespace kernels {
|
||||
private:
|
||||
double precision_;
|
||||
size_t circle_segments_;
|
||||
CGAL::Nef_polyhedron_3<Kernel_> precision_cube_;
|
||||
// CGAL::Nef_polyhedron_3<Kernel_> precision_cube_;
|
||||
|
||||
bool preprocess_boolean_operand(const IfcUtil::IfcBaseClass* log_reference, const cgal_shape_t& shape_const, CGAL::Nef_polyhedron_3<Kernel_>& result, bool dilate);
|
||||
bool thin_solid(const CGAL::Nef_polyhedron_3<Kernel_>& a, CGAL::Nef_polyhedron_3<Kernel_>& result);
|
||||
|
||||
CGAL::Nef_polyhedron_3<Kernel_> create_precision_cube_() const {
|
||||
auto cc = utils::create_cube(precision_);
|
||||
return CGAL::Nef_polyhedron_3<Kernel_>(cc);
|
||||
}
|
||||
public:
|
||||
|
||||
CgalKernel()
|
||||
@@ -82,8 +87,7 @@ namespace kernels {
|
||||
, precision_(1.e-5)
|
||||
, circle_segments_(16)
|
||||
{
|
||||
auto cc = utils::create_cube(precision_);
|
||||
precision_cube_ = CGAL::Nef_polyhedron_3<Kernel_>(cc);
|
||||
|
||||
}
|
||||
|
||||
void remove_duplicate_points_from_loop(cgal_wire_t& polygon);
|
||||
@@ -102,7 +106,7 @@ namespace kernels {
|
||||
virtual bool convert_impl(const taxonomy::extrusion*, ifcopenshell::geometry::ConversionResults&);
|
||||
virtual bool convert_impl(const taxonomy::boolean_result*, ifcopenshell::geometry::ConversionResults&);
|
||||
|
||||
const CGAL::Nef_polyhedron_3<Kernel_>& precision_cube() const { return precision_cube_; }
|
||||
CGAL::Nef_polyhedron_3<Kernel_> precision_cube() const { return create_precision_cube_(); }
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -346,7 +346,7 @@ struct collection : public geom_item {
|
||||
|
||||
collection() {}
|
||||
collection(const collection& other) {
|
||||
std::transform(other.children.begin(), other.children.end(), std::back_inserter(children), std::mem_fun(&item::clone));
|
||||
std::transform(other.children.begin(), other.children.end(), std::back_inserter(children), std::mem_fn(&item::clone));
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
|
||||
@@ -243,7 +243,7 @@ namespace IfcParse {
|
||||
|
||||
std::vector<const inverse_attribute*> inverse_attributes_;
|
||||
|
||||
class attribute_by_name_cmp : public std::unary_function<const attribute*, bool> {
|
||||
class attribute_by_name_cmp {
|
||||
private:
|
||||
std::string name_;
|
||||
public:
|
||||
@@ -399,14 +399,14 @@ namespace IfcParse {
|
||||
std::vector<const enumeration_type*> enumeration_types_;
|
||||
std::vector<const entity*> entities_;
|
||||
|
||||
class declaration_by_name_cmp : public std::binary_function<const declaration*, const std::string&, bool> {
|
||||
class declaration_by_name_cmp {
|
||||
public:
|
||||
bool operator()(const declaration* decl, const std::string& name) {
|
||||
return decl->name_lc() < name;
|
||||
}
|
||||
};
|
||||
|
||||
class declaration_by_index_sort : public std::binary_function<const declaration*, const declaration*, bool> {
|
||||
class declaration_by_index_sort {
|
||||
public:
|
||||
bool operator()(const declaration* a, const declaration* b) {
|
||||
return a->index_in_schema() < b->index_in_schema();
|
||||
|
||||
Reference in New Issue
Block a user