Giter VIP home page Giter VIP logo

Comments (4)

gkjohnson avatar gkjohnson commented on June 6, 2024

Though it looks like there's two overlapping triangles unexpectedly:

image

from three-bvh-csg.

gkjohnson avatar gkjohnson commented on June 6, 2024
// split tri
			new THREE.Triangle(
				new THREE.Vector3( 0.1269903190542666, -0.15988833933004354, 0 ),
				new THREE.Vector3( 0.5269903250147311, 0.5329319712626076, 0 ),
				new THREE.Vector3( 0.32699033693566004, 0.5329319712626077, 0.20000000298023224 ),
			)

// splitting tris
			new THREE.Triangle(
				new THREE.Vector3( 0.6000000238418579, 0, 0.20000000298023224 ),
				new THREE.Vector3( 0.30000001192092896, 0.5196152329444885, 0.20000000298023224 ),
				new THREE.Vector3( 0.20000000298023224, 0.3464101552963257, 2.4492935397342132e-17 ),
			),
			new THREE.Triangle(
				new THREE.Vector3( 0.4000000059604645, 0, 2.4492935397342132e-17 ),
				new THREE.Vector3( 0.6000000238418579, 0, 0.20000000298023224 ),
				new THREE.Vector3( 0.20000000298023224, 0.3464101552963257, 2.4492935397342132e-17 ),
			),
			new THREE.Triangle(
				new THREE.Vector3( 0.4000000059604645, 0, 2.4492935397342132e-17 ),
				new THREE.Vector3( 0.20000000298023224, 0.3464101552963257, 2.4492935397342132e-17 ),
				new THREE.Vector3( 0.30000001192092896, 0.5196152329444885, -0.20000000298023224 ),
			),
			new THREE.Triangle(
				new THREE.Vector3( 0.800000011920929, 0, -4.8985870794684264e-17 ),
				new THREE.Vector3( 0.6000000238418579, 0, -0.20000000298023224 ),
				new THREE.Vector3( 0.4000000059604645, 0.6928203105926514, -4.8985870794684264e-17 ),
			),
			new THREE.Triangle(
				new THREE.Vector3( 0.800000011920929, 0, 0 ),
				new THREE.Vector3( 0.4000000059604645, 0.6928203105926514, 0 ),
				new THREE.Vector3( 0.30000001192092896, 0.5196152329444885, 0.20000000298023224 ),
			)

from three-bvh-csg.

gkjohnson avatar gkjohnson commented on June 6, 2024

reduced problem triangle set

const tri = new THREE.Triangle(
	new THREE.Vector3( 0.1269903190542666, -0.15988833933004354, 0 ),
	new THREE.Vector3( 0.5269903250147311, 0.5329319712626076, 0 ),
	new THREE.Vector3( 0.32699033693566004, 0.5329319712626077, 0.20000000298023224 ),
);

const tris = [

	// lower tri
	new THREE.Triangle(
		new THREE.Vector3( 0.4000000059604645, 0, 2.4492935397342132e-17 ),
		new THREE.Vector3( 0.6000000238418579, 0, 0.20000000298023224 ),
		new THREE.Vector3( 0.20000000298023224, 0.3464101552963257, 2.4492935397342132e-17 ),
	),

	// upper tri
	new THREE.Triangle(
		new THREE.Vector3( 0.800000011920929, 0, 0 ),
		new THREE.Vector3( 0.4000000059604645, 0.6928203105926514, 0 ),
		new THREE.Vector3( 0.30000001192092896, 0.5196152329444885, 0.20000000298023224 ),
	)
];

from three-bvh-csg.

gkjohnson avatar gkjohnson commented on June 6, 2024

Fixed in gkjohnson/three-mesh-bvh#438

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.