The expansion of ThreeCSG results in a flawed mesh

Seeking assistance on creating a rounded cube using the ThreeCSG expand function for a csg model. The resulting mesh appears incorrect and I am unable to identify the issue. Is there anyone with expertise in ThreeCSG who can help me troubleshoot? Thank you.

var a = CSG.cube();
var b = a.expand( 0.4, 6 ); 
this.m_scene.add( new THREE.Mesh( THREE.CSG.fromCSG( b ), new THREE.MeshNormalMaterial() ) );

Preview of the mesh:

https://i.sstatic.net/58Mvz.png
(source: jvanderspek.com)

Thank you,

Jonathan

Answer №1

It appears that your vertexNormals are experiencing some issues. It seems like they may have gotten "lost in translation."

You can take a look at this response on a different question for potential solutions. The problem you're facing might be similar.

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

Utilizing a dropdown list in HTML to dynamically change images

On my HTML page, I have implemented a dropdown list box. My objective is to change an image and update a label based on the selection made from the dropdown list box. I already have an array called 'temp' which represents the number of items. The ...

Retrieving JSON information from the server

I have been working with the knockout.js framework and adapted a basic contacts form example to suit my needs. I am able to successfully store values in my database, but I am encountering difficulties when trying to load values from the server. Despite h ...

Guide to assigning a value to a model in AngularJS by utilizing a select input with an array of objects

I'm new to AngularJS and I've encountered a challenge that requires an elegant solution. My application receives a list from the server, which is used as the data source for the select tag's options. Let's assume this list represents a ...

Retrieve the error message from the service and pass it to the controller in AngularJS

Utilizing a factory to fetch rates via REST .factory('rateResource', ['$resource', function ($resource) { return $resource('/rates/:currency/:effectiveDate', { currency: '@currency', effectiveDat ...

Ways to detect scrolling activity on the v-data-table module?

Are you looking for a way to detect scrolling events on the v-data-table component in Vuetify framework? I am referring to the scenario where the table has a fixed height, causing the table body to scroll. <v-data-table fixed-header :height=400 : ...

Error: Unable to access undefined properties (attempting to read 'getBoundingClientRect')

I keep encountering the issue TypeError: Cannot read properties of undefined (reading 'getBoundingClientRect') while working in React on my localhost with Node.js. I can't figure out what's causing it. import React,{useRef,useState} fro ...

An issue occurred during payment processing with NodeJS, ExpressJS, and Stripe that resulted in a Parse Error

https://i.sstatic.net/GXLaV.png Functioning well on: Windows (Windows 10, Node v13.10.1, NPM 6.14.4) Encountering error on: Linux (Ubuntu 18.04, Node v12.16.2, NPM 6.14.4) Whenever I make a payment using the Linux web server using either Stripe live key ...

What is the best way to utilize a single Google Map component instance across multiple children?

Seeking a method to maintain the same Google Map instance throughout my entire app, as each map load incurs charges... Currently utilizing google-map-react. An instance of a new Map is created in ComponentDidMount, suggesting that it's important to k ...

Unit testing React Native for inputting text values

I am attempting to append a unit to the value of a textInput: https://i.sstatic.net/EqswS.jpg I have attempted to achieve this with the following code but have not been successful: value = { this.state.totalWeight + " Kgs"} I also tried adding ...

Invoke a component and initiate a click event from within the App.vue component

Within my template, there is a click event: <span v-on:click="showGalery()"> This event is linked to the following method: export default { name: 'osaka', data: function () { return { galery: false, } }, methods: { ...

What is the best way to incorporate a year select feature in react-dates?

Swiping through months on react-dates until reaching the correct year can be frustrating. Would it be feasible to incorporate a selection option for both the year and month? ...

Utilizing Normal Mapping with ShaderMaterial, TangentSpace, and fromGeometry in Three.js

I've been struggling to understand normal mapping with Three.js. Despite my efforts, I can't seem to get it right. Below is the code I've been working on: Javascript: var bufferGeometry = new THREE.BufferGeometry(); bufferGeometry.fromGeo ...

What is the best way to modify values within arrays of objects in JavaScript?

I need to update the values in an array of objects. The keys 1 and 2 are dynamic and pulled from a JSON file. var rows = [ { "1": "14", "2": "55", "named": "name1", "row&quo ...

Form submission causing page to reload, getElementById function fails to return value, rendering form ineffective

The objective of this code snippet is to extract data from a form using IDs and store it in an array object named studRec. The entire process is intended to be carried out on the client-side in order to preserve the data for future use in other functions. ...

Is foreach not iterating through the elements properly?

In my code, I have a loop on rxDetails that is supposed to add a new field payAmount if any rxNumber matches with the data. However, when I run the forEach loop as shown below, it always misses the rxNumber 15131503 in the return. I'm not sure what I ...

Managing JSON responses from a server using Javascript

I have encountered various similar issues, but none of them have provided a solution for my specific question. On my server, I generate a JSON string and place it in the response: List<String> list = getSomeList(); JSONArray jsArray = new JSONArray( ...

Error encountered when running shell command in JavaScript due to permission denial

I've been working on a JavaScript code to execute a shell command and open Notepad. Below is my current implementation: <script type="text/javascript"> function runNotepad() { var oShell = new ActiveXObject("Shell.Application"); ...

Conceal a Component within an Embedded Frame

Hey there! I've been attempting to hide a header within an iframe, but it seems like my code isn't doing the trick. Could someone take a look and help me diagnose why the header is still visible? Thanks in advance! <iframe id="booking_iframe" ...

The websocket server implemented in Node.js with the use of the "ws" library is exhibiting a peculiar behavior where it disconnects clients at random intervals,

My WebSocket server implementation is quite simple: const WebSocket = require('ws'); const wss = new WebSocket.Server( { server: server, path: "/ws" }); wss.on('connection', function connection(ws, req) { console.log("Connect ...

encountering an issue: file or directory does not exist, unable to open 'rds-combined-ca-bundle.pem'

I recently downloaded AWS secure socket for my Node server and integrated it into my index.js folder. However, I encountered an error that reads: "Error: ENOENT: no such file or directory, open 'rds-combined-ca-bundle.pem'. Could someone help me ...