When using THREE.ParametricGeometry(func, slices, stacks), the function is executed multiple times

three.js:version:0.121 when I execute this piece of code,

new THREE.ParametricGeometry( func, 200, 10)

var func(u, v, point){
console.log(u,v)
}

output:

0 0
0.00001 0
0 0.00001
0.005 0
0.0049900000000000005 0
0.005 0.00001
0.01 0
0.00999 0
0.01 0.00001
0.015 0
0.01499 0
0.015 0.00001
0.02 0
0.01999 0
0.02 0.00001
0.025 0
...

it appears to be an inaccurate division

when running a similar script in version:0.74

new THREE.ParametricGeometry( func, 200, 10)

var func(u, v){
console.log(u,v)
}

0 0
0.005 0
0.01 0
0.015 0
0.02 0
0.025 0
0.03 0
0.035 0
0.04 0
0.045 0
0.05 0
0.055 0
0.06 0
0.065 0
···

So why does this discrepancy occur, with version 0.121 failing to display the outcome correctly?

Answer №1

The latest updates to the parametric function include adjustments made in version r85 to address a bug related to normal computation. For further details, check out the PR here: https://github.com/mrdoob/three.js/pull/11056

It's important to note that this bug fix does not impact other vertex information within the function.

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

When utilizing the Express framework, the object req.body is initially empty when collecting data from a basic

I'm encountering an issue where I receive an empty object in req.body when submitting my HTML form. This problem persists whether testing in Postman or directly submitting the form from localhost in the browser. Upon logging it in the node console, t ...

building responsive servers within Gulp using connect

Can I validate the availability of a server port before creating it using Gulp? Currently, this is my approach: /** * Start LiveReload Server */ gulp.task('connect', function() { var connect = require('connect'), app = ...

Printing using *ngFor will display items in an ascending order

When attempting to display an object in markup, I am running into the issue of *ng printing it in ascending order instead of maintaining the original order. Ideally, I would like the elements to be printed as they are. You can view my code on StackBlitz ...

What is the method for replicating form fields using Javascript?

Let's say you want an HTML form that is structured like the following: <table> <tr> <td>Field A:</td> <td><input type='text' name='fielda[1]'></td> <td>Field B:</ ...

object passed as value to competent parent

I'm facing an issue where I am trying to pass a value to the parent component, but it is returning an object instead of the expected value. Here's what I have: Child Component render() { return ( this.props.data.map((val, idx) => { ...

Encountering an error while setting up the object spread operator Babel plugin for ES201

Exploring the possibilities of the new ES2018 spread operator for objects led me to discovering a promising NPM package: babel-plugin-transform-object-rest-spread Here's a glimpse of my package.json: // Scripts section "scripts": { "dev": " ...

Combining and grouping objects by their IDs in a JavaScript array

Information: [ { "id": "ewq123", "name": "Joshua", "order": "Pizza" }, { "id": "ewq123", "name": "Joshua", "order": ...

Encountering a node globby error when implementing multiple patterns

Currently, I am successfully using node glob for folder1 as shown below: glob('folder1/*.js'), function(err, files){ if (err) { console.log('Not able to get files from folder: ', err); } else { files.forEach(function (file) ...

assisting with the transition effect using CSS3, JS, or jQuery

I am looking to alter the background-image of this particular image when transitioning to another one from my images folder, similar to this example. Below is the code that I have: CSS .image { position: relative; overflow: hidden; -webkit-tr ...

Enhance the performance of node.js when processing data from a massive file

My dilemma lies in the challenge of reading and processing a large file with numerous rows. When dealing with small files under 50kb, everything runs smoothly. However, I am faced with a 15MB file for a programming competition, which serves as a hard input ...

Tips for utilizing Vue 'component' with just Vue added as a page add-on using <script>:

I am trying to incorporate a Vue component called vue-timeago: import VueTimeago from 'vue-timeago' Vue.use(VueTimeago, { name: 'Timeago', // Component name, `Timeago` by default locale: undefined, // Default locale locales: { ...

Is it possible to modify the size of a bullet image in Javascript?

Can an image bullet style loaded via a URL be resized using JavaScript code like this: var listItem = document.createElement('li'); listItem.style.listStyleImage = "url(some url)"; listItem.style.listStylePosition = "inside"; I aim to increase ...

Even in the face of errors, Selenium with Node.js continues to run seamlessly. The challenge arises specifically with the 107.xx version of the Chrome browser and Chrome driver

Currently, I am employed in a project involving NODE JS (javascript) with selenium webdriver. Package.json- “chai”: “^4.3.6”, “chromedriver”: “^107.0.3”, “geckodriver”: “^3.2.0”, “mocha”: “^10.0.0”, “mochawesome”: “^7. ...

Distinguishing $x and x as variable declarations in JavaScript and JQuery: what sets them apart?

Can someone explain the difference between $x and x as variable declarations in Javascript & JQuery? For instance, if I use var x = 5; $x = 5; x = 5; Does each declaration carry a different meaning? Is there a scope implication or am I simply muddling th ...

Is it possible to utilize the element tags from a different custom directive as the template for a new custom directive?

Recently started using angularjs and working on a web application that incorporates custom directives. I want users to have the ability to choose which directives they see upon logging in. To achieve this, I am storing the selected custom directive tags in ...

Using jQuery to filter or duplicate options in a select box - a step-by-step guide!

I am struggling with filtering options in two select boxes. One contains projects and the other contains people: <select id="project"> <option data-person_ids="[75,76,77]">None</option> <option data-person_ids="[77]">Project A& ...

Getting the user's name and country using `auth().createUserWithEmailAndPassword` is a simple process

Hey there fellow developers. I'm fairly new to react native and I'm trying to implement firebase authentication for a project. However, I'm stuck on how to include user name and country when using the standard auth().createUserWithEmailAndPa ...

Error: Objects cannot be used as constructors

An Azure Function using JavaScript HTTP Trigger posts activity in a Slack online community for customers. It has been functioning successfully for many years, but after upgrading from version ~2 to ~4, it started throwing an error stating Entities is not ...

Retrieve the scope object using angular.element and the $ID parameter

In order to transfer data from an angular application to scripts that operate outside of angular, I am seeking a solution since I cannot modify the code of the angular app. By utilizing Angular Batarang and NG-Inspector extensions in Chrome, I have identi ...

The Jquery flot plugin is failing to plot the graph accurately based on the specified date

I am currently working on plotting a graph using the jquery flot plugin with JSON data. Here is what I need to do: Upon page load, make an AJAX call to receive JSON data from the server. From the received JSON, add 'x' and & ...