Giter VIP home page Giter VIP logo

Comments (4)

Kalabedo avatar Kalabedo commented on June 25, 2024 1

Here is a fix:

// CSG
const brush1 = new Brush( geometry );
brush1.material = material
brush1.updateMatrixWorld();

const brush2 = new Brush( geometry2 );
brush2.material = material2
brush2.position.z = 0.45;
brush2.updateMatrixWorld();

const evaluator = new Evaluator();
evaluator.useGroups = true
evaluator.consolidateMaterials = true
const result = evaluator.evaluate( brush1, brush2, SUBTRACTION );

let index = [];
for (let i = 0; i < result.geometry.attributes.position.count; i++)
  index.push(i);
result.geometry.setIndex(index);

scene.add(result)

With the help of thrax, we found out, that the geometry is not indexed after the subtraction. setting an index fixed the issue with exporting. So you were right i think, it is an Exporter issue

from three-bvh-csg.

gkjohnson avatar gkjohnson commented on June 25, 2024

From the docs:

CSG results use Geometry.drawRange to help maintain performance which can cause three.js exporters to fail to export the geometry correctly. It is necessary to convert the geometry to remove the use of draw range before exporting with three.js exporters.

from three-bvh-csg.

gkjohnson avatar gkjohnson commented on June 25, 2024

Either way this is an issue related to an exporter if three.js is not exporting geometry as it's rendered in the application and should be reported elsewhere. At least a warning should be logged.

from three-bvh-csg.

Kalabedo avatar Kalabedo commented on June 25, 2024

Either way this is an issue related to an exporter if three.js is not exporting geometry as it's rendered in the application and should be reported elsewhere. At least a warning should be logged.

I tried with other CSG libraries and the exporting works fine so i thought the implementation in this library does something different with the materials

from three-bvh-csg.

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.