The Javascript thinplate interpolation failed to compile with the provided centers because they are not unique. Make sure the centers are distinct

Hey there,

I'm currently in the process of creating a 3D model that involves interpolating pressure values across a 3D surface. To achieve this, I have access to 144 coordinates with corresponding pressure values that serve as known points for my model.

The main goal is to generate a detailed pressure map throughout the entire model based on these initial data points.

My approach has involved using the Thinplate node package. However, during implementation, I encountered the following error:

rbf failed to compile with given centers.
Centers must be unique :/

You can find the code snippet below where I pass array values into the function:

If you have any insights on what might have caused the issue or alternate methods to help me achieve the same outcome, please do share your thoughts.

Thanks, Adam

Code:

const sensor_locations = [insert array values here]
const sensor_pressures_raw = [insert array values here]

// rest of the code goes here...

fitpoints

individual coordinate arrays would be listed here...

Answer №1

The error message is pretty straightforward, stating that "Centers must be unique". In this case, both point 39 and 40 have identical coordinates:

39: Array(3) [ 155.89410400390625, 97.5911865234375, -16.125219345092773 ]
​​40: Array(3) [ 155.89410400390625, 97.5911865234375, -16.125219345092773 ]

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

Guide on combining vendor CSS files in a React application using Webpack

Incorporating third-party libraries is an essential part of my project. For example, I have Mapbox GL installed via npm, which comes with CSS files needed for its functionality. The Mapbox GL CSS file can be found at mapbox-gl/dist/mapbox-gl.css in the no ...

The inclusion of <script> tag within the response received from an Ajax

Is there a way to update an element's innerHTML using Ajax.request that includes <script> tags? <div><script type="text/javascript">javascript</script></div> I want to update the content of a div with code from above wi ...

Passing a class as a parameter in Typescript functions

When working with Angular 2 testing utilities, I usually follow this process: fixture = TestBed.createComponent(EditableValueComponent); The EditableValueComponent is just a standard component class that I use. I am curious about the inner workings: st ...

What causes let to lose significance within the context of React development?

In my React code snippet, I am encountering an issue with the organizationId variable. Even though I can see its value in the first and second instances, I am unable to see it in the third instance. This strange behavior is occurring in a Next.js based pro ...

Sending a POST request from AngularJS to the SLIM Framework appears to be causing issues

Greetings! I am facing an issue with my AngularJS http.post() request to the Slim PHP framework. 'use strict'; soup.factory('loginService',function($http){ return { login:function(user){ console ...

Div refuses to change its size

This question has been resolved To achieve the desired layout, I adjusted the position of two children elements to 'absolute' since they will not change in size. I then repositioned the other children whose sizes remain constant to the top. Fina ...

Tips for containing a range slider within a div element in a flexbox container

I am currently using Javascript to generate a grid of images, and I want to include a range slider at the bottom of one of the images. Here is a simplified version of my code using flex-container: <style> .flex-container { display: flex; fle ...

Unable to move an element with Webdriver in Java Script

Trying to Drag an Element with the Following Code - "WebElement baseElement = driver.findElement(By.xpath("Element ID"); Actions clicker = new Actions(driver); clicker.moveToElement(baseElement).moveByOffset(20,0).click().perform(); Encount ...

.htaccess file is causing js and css files to not load

I followed an MVC tutorial by howcode on YouTube, but I encountered an issue where my CSS and JS files were not loading due to the htaccess configuration. .htaccess file: RewriteEngine On RewriteRule ^([^/]+)/? index.php?url=$1 [L,QSA] I attempted vario ...

Passing a function as a parameter to custom hooks does not update the values of variables

Utilizing this custom hook allows me to listen for the window unload event. import { useRef, useEffect } from 'react'; const useUnload = fn => { const cb = useRef(fn); useEffect(() => { cb.current = fn; }, [fn]); ...

The form I created retrieves select options via an ajax call, but after saving, the post values are not displaying as expected

I have created a form with the following HTML code snippet: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Populate City Dropdown Using jQuery Ajax</title> <script type="text/javascript" src="h ...

Mapping nested array of references in Angular Firestore

I am working with a collection called A, which contains documents that reference other documents in collection B. https://i.sstatic.net/C1HtT.png When fetching my A documents from the service, I receive an array of objects that are not usable. However, I ...

Minimize duplication of HTML code by refraining from PHP usage

It seems like this task may be simple for some individuals. To prevent redundancy in code across multiple pages, my goal is to insert segments of HTML code without having to manually input all of the elements each time. It's similar to a page controll ...

Vue.js versatile form for both adding and editing

As a newcomer to the world of vue.js, I am currently working on expanding some tutorials that I have completed. After struggling with this for three hours now, I must admit that I am feeling quite frustrated. Just to give you a heads up, I am using firebas ...

Discovering how to use the selenium-webdriver npm to navigate to a new window from a target="_blank" attribute

While trying to create a collection of selenium tests, I encountered an obstacle with the javascript selenium-webdriver npm package. One specific test involves selenium verifying that a target="_blank" link functions properly by checking the content of th ...

JavaScript does not seem to be functioning properly when loading data through ajax

I have created an image gallery using PHP and implemented a JavaScript code to create a CSS "overlay" effect when the image is clicked. <script type="text/javascript"> $(".button").click(function(e) { e.preventDefault(); $.ajax({ ...

What is the best way to retrieve a specific value from a set of elements that share the same name?

My dilemma lies in handling two radio buttons that share the same name but have different values. I need to ensure that the correct value is selected before allowing the form to be submitted, and prompt the user if an incorrect selection is made. Below is ...

Tips for ensuring a button functions for only the specific element clicked, not all elements in a rendered list

I have a list that was generated from an array, with each element having a menu button that opens a modal specific to that element. However, I am facing an issue where clicking on the button for one index triggers the modal for all indexes instead of just ...

Can you please specify the format of this list?

When I receive data in the following format: "result": {"FirstData": {"One": 1, "Two": 2,... Firstly, what is this typically called in Java (2D array)? Secondly, how can I iterate over this to extract the strings? I know that if I only had "FirstData" ...

Enabling and disabling multiple input fields based on the status of a checkbox in order to manage dynamic inputs

I need help with a situation involving dynamic input fields and checkboxes. My goal is to disable the input field if the checkbox with the corresponding ID is checked. Here is the PHP code snippet: <table class="table table-striped"> <thead& ...