GithubHelp home page GithubHelp logo

csgjs-cpp's People

Contributors

dabroz avatar smokris avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

csgjs-cpp's Issues

Plane splitting issue

If I have a cube that has a uniform scale of 1.0 and perform a union with a smaller cube that only intersects with one plane (side) of the first cube, the opposite side of the first cube also ends up with added vertices despite having no intersection. Is there a way to restrain the algorithm to the plane or planes that intersect?

The splits seem OK on the faces that required splitting, so I feel the algorithm could be improved instead of adding any post functions to reduce excessive vertices on a plane.

stuck in infinite loop

Hi !

I experienced csgjs to get stuck in build trying to split one polygon against itself over and over because the coplanar test fails in splitPolygon() because of precision issues. I was able to enhance it by making epsilon larger. But what solved it for me was not trying to split the polygon against itself at all. So in csgjs_csgnode::build() I replaced

	for (size_t i = 1; i < list.size(); i++)
		me->plane.splitPolygon(list[i], me->polygons, me->polygons, list_front, list_back);

with

	me->polygons.push_back(list[0]);
	for (size_t i = 1; i < list.size(); i++)
		me->plane.splitPolygon(list[i], me->polygons, me->polygons, list_front, list_back);

splitPolygons() would theoretically add the polygon list[0] to me->polygons if there weren't precision errors. So I just do this upfront and start with i = 1. I'm not sure if this breaks somethign else but it still looks good to me and I don't get these infinite loops.

Thank you!

I just want to say, thanks for this library, even if it's just a port from other language. You really saved me many hours of work (even though I already been struggling with CSG for past month). Because I found a bug in it - float variables makes too large meshes to crash on boolean operations - soon I will make some pull request to your library, even fork it with some examples. So for now - thanks from other Warsaw dweller! :) (I owe you a big beer)

Cheshire Cat

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.