Performing operations such as intersection, merging, and differentiation in 2D using Three.js CSG

Currently, my csg.js with three.js setup is limited to 3D CSG operations. Take a look at this resource for more information.

I am interested in performing intersection and union operations on 2D geometries created using three.js. Is there a method to achieve 2D CSG within the three.js framework?

Answer №1

It's important to remember that planes are essentially infinitely thin. So, when two planes intersect, you end up with a one-dimensional line without any visible faces. Even if you try to use a 2D plane with a solid object, it may not work as intended because the plugin is designed to work with solids.

Consider the types of output you'll get when different geometries intersect:

If you need a plane as an output, it's recommended to intersect with a very thin box, like a 2 x 2 x 0.01, instead of using actual 2D planes. Think of it like using a cookie-cutter.

Furthermore, ensure you're working with manifold geometry rather than non-manifold. You can find more information on this topic here:

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Using Axios and Typescript to filter an array object and return only the specified properties

I'm currently working on creating an API to retrieve the ERC20 tokens from my balance. To accomplish this, I am utilizing nextjs and axios with TypeScript. However, I'm encountering an issue where the response from my endpoint is returning exces ...

Is it possible to perform a comprehensive text search in Mongoose using multiple criteria and connecting them with an AND operator?

Currently, I am able to smoothly perform a full text search using just one word. However, I'm facing difficulty in searching for multiple parameters or entering them at the same time. This is how my function looks like: export const searching = ( ...

After running once, collection functions do not return a function

I am currently working on a project that incorporates Vue components and utilizes the collection design pattern to manipulate lists. Within the collection, there is a function called arr.add that successfully adds a new object to the list when a button is ...

Update google maps markers and infoBubbles dynamically with ajax

I am currently using asp mvc in conjunction with jquery and the google maps api to showcase and update various locations on a map. Main Objective: Utilize markers to mark multiple locations Display brief information about these locations using info ...

Checking an array of objects for validation using class-validator in Nest.js

I am working with NestJS and class-validator to validate an array of objects in the following format: [ {gameId: 1, numbers: [1, 2, 3, 5, 6]}, {gameId: 2, numbers: [5, 6, 3, 5, 8]} ] This is my resolver function: createBet(@Args('createBetInp ...

Adjusting the visibility leads to modification of the font size

My iPhone seems to be the only device affected by this issue. Every time I toggle the visibility of an element, it results in a different font size. The problem only arises when I show and hide multiple elements within the "Show All" section. <style& ...

Creating a curved exponential data set with specific endpoints and a set number of data points

Struggling to create a function that involves math skills, I could really use some assistance. The task is to design a function that takes data points x and generates an array of size x with exponentially increasing values from 0 to 100. It would be ideal ...

jqWidgets: The information and table are not appearing on the screen

In my Angular project, I am utilizing jqWidgets to create a grid using jqxGrid. Following the demo found here, I attempted to set up a table grid. However, upon viewing the grid in the browser, only the column names are visible without any borders around ...

Fade into the world of jQuery with text gracefully appearing and disappearing, only to be replaced by new captivating

I am diving into the world of jQuery for the first time. Even though I'm taking an online class on it, using it in a website is completely new to me. My aim for the homepage is to have "Hello there" appear for 2 seconds, then fade out and be replaced ...

What is the process for converting objects that come back as XML instead of JSON?

Currently facing an issue : The JSON file returned by BE contains keys and values, with some values in XML format. How can I convert them to JSON format as well? This structure is new to me, so any guidance would be greatly appreciated. I am working with ...

What is the best way to retrieve the results from the event handler triggered by window.external.Notify("someText") in order to send them back to JavaScript?

Using window.external.Notify("someText") in my Windows Phone 8 HTML5 Application function func() { window.external.Notify("clearTextBox"); } An event handler for ScriptNotify has been implemented private void BrowserScriptNotify(object sender, Not ...

The HTML changes are not reflected in the document.querySelectorAll function

Trying to select all the div elements within another div using document.querySelectorAll. Interestingly, when setting the height to 1000 in the JS, the browser's scrollbar adjusts accordingly (the balloons do not change size). What could I be doing in ...

Having trouble selecting categories (Y-axis) on the gantt chart following the series data update

Intended Functionality : Upon updating chart data, users should be able to click on Categories (Y-axis) and expand the child elements related to the clicked category. Actual Observation : After updating the chart data, the following issues were noticed: ...

Navigate to a particular slide within a Bootstrap carousel by clicking on the designated link

I've been trying to figure out how to create links to specific slides within my bootstrap carousel. I've experimented with all the solutions found here, including both the JavaScript and non-JavaScript options. I've tried using regular ancho ...

Something seems to be missing in Vue.js as it cannot compute the property 'length' of null

When I attempt the following: <div class="panel panel-default" v-if="socialiteLogins !== null"> The panel remains visible. Checking socialiteLogins === null or with == both indicate that the object is not null, even though it actually is. When dump ...

Issue with EnumDeserializer in jackson-mapper 1.9.12 version

I'm currently working on a scenario where I need to map a String to an enum Object using the Jackson ObjectMapper.readValue(String,Class) API. The issue arises when my JSON string contains a Task Object with an Action enum defined as follows: public ...

What could be causing Wordpress Jquery to only function properly after a page refresh?

Here is the code snippet I am working with: <script type="text/javascript"> jQuery( document ).ready(function() { jQuery('#bookbtn_loc_1').on('click', function(event){ jQuery("a.da-close").click(); ...

Calculate the total number of blank input boxes within a specific row of the table

What is the method to count the number of input boxes without a value in a table row using jquery? For instance: <table id="table1"> <tr class="data" id="row5"> <td><input type="text" value="20%" /></td> <td><input ...

Node's Object.prototype function returns an empty object

When I run Object.prototype in the browser console, I see all the properties and methods within it. However, when I do the same thing in the NodeJS terminal, I get an empty object {}. Can someone explain why this difference occurs? Attached are screenshots ...

What is the process for utilizing JEST to test a REST API built with Express?

Is it possible to solely use JEST for testing my rest API endpoints in express? I've undertaken various articles and browsed through questions on Stack Overflow to explore how this can be achieved. However, it seems like most individuals prefer using ...