Coder Social home page Coder Social logo

Comments (1)

maleadt avatar maleadt commented on July 27, 2024

As per this thread, replacing BRepMesh::Mesh with BRepMesh_IncrementalMesh fixes this.

These are all the changes I had to make to HeeksCAD in order to get it compiled:

Index: interface/Geom.cpp
===================================================================
--- interface/Geom.cpp  (revision 1711)
+++ interface/Geom.cpp  (working copy)
@@ -1165,7 +1165,7 @@
    gp_Trsf tr;
    try
 {
-   tr.SetValues(m[0], m[1], m[2], m[3], m[4], m[5], m[6], m[7], m[8], m[9], m[10], m[11], 0.0001, 0.00000001);
+   tr.SetValues(m[0], m[1], m[2], m[3], m[4], m[5], m[6], m[7], m[8], m[9], m[10], m[11]);
 }
    catch(...)
 {
Index: src/ConversionTools.cpp
===================================================================
--- src/ConversionTools.cpp (revision 1711)
+++ src/ConversionTools.cpp (working copy)
@@ -637,7 +637,7 @@
        {
            // make lots of small lines
            BRepTools::Clean(edge);
-           BRepMesh::Mesh(edge, deviation);
+           BRepMesh_IncrementalMesh(edge, deviation);

            TopLoc_Location L;
            Handle(Poly_Polygon3D) Polyg = BRep_Tool::Polygon3D(edge, L);
Index: src/Edge.cpp
===================================================================
--- src/Edge.cpp    (revision 1711)
+++ src/Edge.cpp    (working copy)
@@ -79,7 +79,7 @@
        {
            BRepTools::Clean(m_topods_edge);
            double pixels_per_mm = wxGetApp().GetPixelScale();
-           BRepMesh::Mesh(m_topods_edge, 1/pixels_per_mm);
+           BRepMesh_IncrementalMesh(m_topods_edge, 1/pixels_per_mm);
            if(marked){
                glGetFloatv(GL_DEPTH_RANGE, save_depth_range);
                glDepthRange(0, 0);
Index: src/Face.cpp
===================================================================
--- src/Face.cpp    (revision 1711)
+++ src/Face.cpp    (working copy)
@@ -36,7 +36,7 @@
 void CFace::glCommands(bool select, bool marked, bool no_color){
    bool owned_by_solid = false;
    if(GetParentBody()) {
-       // using existing BRepMesh::Mesh
+       // using existing BRepMesh_IncrementalMesh
        // use solid's colour
        owned_by_solid = true;

@@ -109,7 +109,7 @@

 void CFace::GetTriangles(void(*callbackfunc)(const double* x, const double* n), double cusp, bool just_one_average_normal){
    if(GetParentBody()) {
-       // using existing BRepMesh::Mesh
+       // using existing BRepMesh_IncrementalMesh
    }
    else {
        MeshFace(m_topods_face,1/cusp);
Index: src/FaceTools.cpp
===================================================================
--- src/FaceTools.cpp   (revision 1711)
+++ src/FaceTools.cpp   (working copy)
@@ -28,7 +28,7 @@
 void MeshFace(TopoDS_Face face, double pixels_per_mm)
 {
    BRepTools::Clean(face);
-   BRepMesh::Mesh(face, 1/pixels_per_mm);
+   BRepMesh_IncrementalMesh(face, 1/pixels_per_mm);
 }

 void command_callback(const double* x, const double* n)
@@ -175,7 +175,7 @@
        // ni  : sommet i du triangle courant
        for (nt = 1; nt <= nnn; nt++)                   
        {
-           if (SST.Orientation(face) == TopAbs_REVERSED)           // si la face est "reversed"
+           if (face.Orientation() == TopAbs_REVERSED)          // si la face est "reversed"
                triangles(nt).Get(n1,n3,n2);                        // le triangle est n1,n3,n2
            else 
                triangles(nt).Get(n1,n2,n3);                        // le triangle est n1,n2,n3
Index: src/Ruler.cpp
===================================================================
--- src/Ruler.cpp   (revision 1711)
+++ src/Ruler.cpp   (working copy)
@@ -383,7 +383,7 @@
    config.Read(_T("RulerTrsf32"), &m32, 0.0);
    config.Read(_T("RulerTrsf33"), &m33, 1.0);
    config.Read(_T("RulerTrsf34"), &m34, 0.0);
-   m_trsf.SetValues(m11, m12, m13, m14, m21, m22, m23, m24, m31, m32, m33, m34, 0.0001, 0.00000001);
+   m_trsf.SetValues(m11, m12, m13, m14, m21, m22, m23, m24, m31, m32, m33, m34);

    config.Read(_T("RulerUseViewUnits"), &m_use_view_units);
    config.Read(_T("RulerUnits"), &m_units);
Index: src/Shape.cpp
===================================================================
--- src/Shape.cpp   (revision 1711)
+++ src/Shape.cpp   (working copy)
@@ -167,7 +167,7 @@
 {
    double pixels_per_mm = wxGetApp().GetPixelScale();
    BRepTools::Clean(m_shape);
-   BRepMesh::Mesh(m_shape, 1/pixels_per_mm);
+   BRepMesh_IncrementalMesh(m_shape, 1/pixels_per_mm);
 }

 void CShape::glCommands(bool select, bool marked, bool no_color)
@@ -264,7 +264,7 @@
    {
        if(m_faces == NULL)create_faces_and_edges();
        BRepTools::Clean(m_shape);
-       BRepMesh::Mesh(m_shape, 1.0);
+       BRepMesh_IncrementalMesh(m_shape, 1.0);
        if(m_faces)m_faces->GetBox(m_box);
    }

@@ -289,7 +289,7 @@
 #ifdef TESTNEWSHAPE
                //This will end up throwing 90% of the exceptions caused by a bad offset
                BRepTools::Clean(new_shape);
-               BRepMesh::Mesh(new_shape, 1.0);
+               BRepMesh_IncrementalMesh(new_shape, 1.0);
 #endif

                HeeksObj* new_object = CShape::MakeObject(new_shape, shape_for_tools->m_title_made_from_id ? wxString(_("Result of 'Offset Shape'")).c_str() : shape_for_tools->m_title.c_str(), SOLID_TYPE_UNKNOWN, shape_for_tools->m_color, shape_for_tools->GetOpacity());
@@ -1026,7 +1026,7 @@

 void CShape::GetTriangles(void(*callbackfunc)(const double* x, const double* n), double cusp, bool just_one_average_normal){
    BRepTools::Clean(m_shape);
-   BRepMesh::Mesh(m_shape, cusp);
+   BRepMesh_IncrementalMesh(m_shape, cusp);

    return IdNamedObjList::GetTriangles(callbackfunc, cusp, just_one_average_normal);
 }
Index: src/stdafx.h
===================================================================
--- src/stdafx.h    (revision 1711)
+++ src/stdafx.h    (working copy)
@@ -94,6 +94,7 @@
 #include <BRepFilletAPI_MakeFillet2d.hxx>
 #include <BRepGProp.hxx>
 #include <BRepMesh.hxx>
+#include <BRepMesh_IncrementalMesh.hxx>
 #include <BRepOffsetAPI_DraftAngle.hxx>
 #include <BRepOffsetAPI_MakeEvolved.hxx>
 #include <BRepOffsetAPI_MakeOffset.hxx>

from heekscad-old.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.