Giter VIP home page Giter VIP logo

Comments (4)

Mugen87 avatar Mugen87 commented on June 15, 2024

Check out the following screenshot:

image

It shows the wireframe of the shape with focus on the left hole. The interesting part is the top side of the quad where you can see the narrow triangle that goes to the right (it's actually the first triangle definition in ShapesGeometry). EdgesGeometry can't properly process the bottom edge of this triangle.

If you translate the second hole slightly upwards, the glitch goes away because the triangulation ends up differently and EdgesGeometry produces your intended output. https://jsfiddle.net/xprqv1ns/

The triangulation isn't wrong, imo. It's just not the expected input for rendering border edges with EdgesGeometry. For now, I would just state that EdgesGeometry can't properly handle shape definitions with holes.

from three.js.

Mugen87 avatar Mugen87 commented on June 15, 2024

You might want to consider to detect the outline with a post processing pass like sobel. The edges would look like so:

image

You could use a custom shader to blend the result over your beauty pass.

from three.js.

ymarneth avatar ymarneth commented on June 15, 2024

Thanks for the analysis @Mugen87. I understand the triangulation issue now. Since the meshes I am working with are generated, simply translating holes will probably not solve my issue reliably. EdgesGeometry does not seem to be the right tool for my use case here.

You are right, in this case it would probably be better to use post processing for the outlines. Thanks for the suggestion.

If this is not a bug from your perspective, feel free to close this issue.

from three.js.

Mugen87 avatar Mugen87 commented on June 15, 2024

I don't think we can update the implementation in a reasonable way such that these use cases are supported. Let's consider this issue as a limitation of EdgesGeometry.

from three.js.

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.