Giter Club home page Giter Club logo

Comments (12)

zippy84 avatar zippy84 commented on June 15, 2024 1

Feel free to submit them now. Maybe it's already fixed.

from vtkbool.

lassoan avatar lassoan commented on June 15, 2024 1

@mallikarjun49 export the meshes (polydata_ and transformFilter_->GetOutput()) to files, upload them somewhere, and post the download links here. It is not possible to reproduce the meshes exactly based on your approximate instructions.

Also note that vtkCylinderSource creates meshes that are very efficient for rendering but almost unusable for 3D modeling, because it creates extremely ill-shaped triangles (that span between the top and bottom planes of the cylinder). Use vtkLineSource and vtkTubeFilter instead, because with that you can create better shaped triangles.

from vtkbool.

lassoan avatar lassoan commented on June 15, 2024 1

Great! Thank you for working on it.

from vtkbool.

mallikarjun49 avatar mallikarjun49 commented on June 15, 2024 1

Thank you very much @zippy84 !!

from vtkbool.

lassoan avatar lassoan commented on June 15, 2024

After adding a _s.empty() check, I got an assert here:

assert(grps.size() == 1);

because number of groups is 2. Replacing the assert with a if (grps.size() > 0) {} check "fixes" the crash but I'm not sure if this is the right thing to do.

from vtkbool.

zippy84 avatar zippy84 commented on June 15, 2024

Hi Andras.

At first I have to say, that the master version is not crash safe. It mostly crashes at this line:

PolyPair pp(opp[0], opp[1]);

Currently I'm working on a new version that fixes that. The lib is also not type-safe. There are many warnings when -Wconversion is enabled. My first changes could be found in the refactoring-branch, but it is not ready yet. The holes-merger an the decomposer are widely commented out.

I will take look for a solution of your issue.

from vtkbool.

lassoan avatar lassoan commented on June 15, 2024

Thank you for the quick response, looking forward to the fix.

We have found some additional issues (such as invalid comparator assert here because A>B and A<B did not provide consistent result), but if you are still working on some improvements then we'll hold this back until those get integrated.

from vtkbool.

mallikarjun49 avatar mallikarjun49 commented on June 15, 2024

PolyPair pp(opp[0], opp[1]);

Currently I'm working on a new version that fixes that.

Hi @zippy84,
Thank you very much for this library. I am trying to use boolean difference of this filter on my meshes. Most of the time it is working fine but some cases my program is crashing at the above mentioned line(#L2854 of vtkPolyDataBooleanFilter.cxx). I am using this filter in a loop and some times at the edge of the Sphere mesh if I do boolean diff operation I get an error message saying "Stripes are invalid" with some part of the mesh is left behind( Can see small parts of the mesh spiked at the edges in the attached image) and if I try to do difference operation on this area, then my program is crashing.
I see in this thread, you are already working on this issue. Do you have any suggestions to stop this crash until your fix is integrated into master branch?
Screenshot from 2021-03-12 12-49-33

from vtkbool.

zippy84 avatar zippy84 commented on June 15, 2024

@mallikarjun49 Can you supply two meshes that does not work?

from vtkbool.

mallikarjun49 avatar mallikarjun49 commented on June 15, 2024

@mallikarjun49 Can you supply two meshes that does not work?

Thank you very much for the quick response. I am basically using vtkSphereSource and vtkCylinderSource to do the difference operation. I am doing this operation in a loop. Basically my cylinder source translates to new position on key press and try to do difference operation on the output of the boolean filter in the previous step.
//loop

{ 
   auto booleanFilter = vtkSmartPointer<vtkPolyDataBooleanFilter>::New();
   booleanFilter->SetInputData(0,polydata_);
   booleanFilter->SetInputData(1,transformFilter_->GetOutput()); //cylinder translates to new position in each iteration
   booleanFilter->SetOperModeToDifference();
   booleanFilter->Update();

   if(booleanFilter->GetOutput()->GetNumberOfCells() > 0)
   {
       polydata_->Initialize();
       polydata_->DeepCopy(booleanFilter->GetOutput());
   }
 }

from vtkbool.

mallikarjun49 avatar mallikarjun49 commented on June 15, 2024

@lassoan Thank you for your suggestions. I have now used vtkLineSource with vtkTubeFilter instead of vtkCylinderSource, and exported the mesh files.
@zippy84 , Please find the attached source code files and the Mesh files for your reference. Source code should work as it is or with minor tweaks to CMakelists.txt.

BoolDiff.zip
MeshFiles.zip
MeshFiles2.zip
Screenshot from 2021-03-15 23-06-38

from vtkbool.

zippy84 avatar zippy84 commented on June 15, 2024

I'm closing this as the code this refers to no longer exists.

from vtkbool.

Related Issues (20)

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.