## Creating a curve using text files

Accueil Forums Créer avec IanniX Creating a curve using text files

• Ce sujet contient 3 réponses, 2 participants et a été mis à jour pour la dernière fois par IanniX, le il y a 3 années.
4 sujets de 1 à 4 (sur un total de 4)
• Auteur
Messages
• #5508 Répondre
Gill
Invité

Hello,

I’m wondering if it’s possible to create a curve using a list of Cartesian coordinates I have as a textfile without having to type them all in by hand? If so, how do I do this?

Thanks in advance, and thank you for making IanniX open source, it’s very valuable for students like me!

Kind regards,

Gill

#5509 Répondre
IanniX
Maître des clés

Hi!

Create a curve (a polyline, not an equation one) and copy it in clipboard.
Then paste it in a text-editor, you’ll discover something useful for you!

#5510 Répondre
Gill
Invité

Thank you, I followed your instructions, and the text file shows me the relevant code which is great, but how can I input my list of coordinates without hand typing them all?

The code for the curve points in the text file I created from copying the curve looks like this:

var points1 = [
{x: 0, y: 0, z: 0, c1x: 0, c1y: 0, c1z: 0, c2x: 0, c2y: 0, c2z: 0},
{x: 0, y: 0.0164766, z: 0, c1x: 0, c1y: 0.00329532, c1z: 0, c2x: -0.00329532, c2y: -0.0131812, c2z: 0}, etc…

But my textfiles are just lists of numbers. Is there a way to input this in the correct syntax?

Thanks again,

Gill

#5514 Répondre
IanniX
Maître des clés

Hi Gill,

With any text editor, you can format your list into our format. Have a look at Notepad++ or any text editor allowing column mode editing!

4 sujets de 1 à 4 (sur un total de 4)
Répondre à : Répondre #5509 dans Creating a curve using text files
Vos informations :