• Products
    • Isadora
    • Get It
    • ADD-ONS
    • IzzyCast
    • Get It
  • Forum
  • Help
  • Werkstatt
  • Newsletter
  • Impressum
  • Dsgvo
  • Press
  • Isadora
  • Get It
  • ADD-ONS
  • IzzyCast
  • Get It
  • Press
  • Dsgvo
  • Impressum

Navigation

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Popular
    • Tags

    [SOLVED] Parsing XYZ coordinates from a text file into Isadora

    How To... ?
    4
    11
    2791
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • bonemap
      bonemap Izzy Guru last edited by Woland

      Hi,

      I am looking for some advice about reading XYZ coordinates into isadora as a stream of numbers. I have looked at using the newer Data Array actor to read the file and this works except that it appears to be interpreting the numeric coordinates as text. But there does not appear to be an option to convert them back into a numeric float.

      There must be a way to do this?

      I have tried formatting the external text file using Microsoft Excel so that the data was then in a tab delimited structure which the Data Array actor could read properly, but this has some other inherent issues.

      Best Wishes

      bonemap

      http://bonemap.com | Australia
      Izzy STD 4.2 | USB 3.6 | + Beta
      MBP 16” 2019 2.4 GHz Intel i9 64GB AMD Radeon Pro 5500 8 GB 4TB SSD | 14.5 Sonoma
      Mac Studio 2023 M2 Ultra 128GB | OSX 15.3 Sequoia
      A range of deployable older Macs

      Michel 1 Reply Last reply Reply Quote 1
      • Juriaan
        Juriaan Tech Staff last edited by Juriaan

        How much precision do you need exactly ?

        The JavaScript actor is capable of splitting your numbers using the str.split(" ") function, it only seems that Isadora will round all output from the JavaScript output ports, so you can't have this numbers that are so precise. Personally I think that you can only use these kind of numbers as text.

        Isadora 3.1.1, Dell XPS 17 9710, Windows 10
        Interactive Performance Designer, Freelance Artist, Scenographer, Lighting Designer, TroikaTronix Community moderator
        Always in for chatting about interaction in space / performance design. Drop me an email at hello@juriaan.me

        bonemap DusX 2 Replies Last reply Reply Quote 1
        • bonemap
          bonemap Izzy Guru @Juriaan last edited by bonemap

          @juriaan said:

          JavaScript

           Thanks Juriaan, it appears that the float is too long for Isadora although I have tested the numbers in a text file with 72 lines of xyz coordinates describing a torus. For this I manually entered tabs using ‘find and replace’ in TextEdit software. The Data Array handled those floats just fine automatically adjusting the numbers to be shorter (as you say rounding them), and I was able to make a point cloud of particles with both the 3D Particles and 3D Model Particles. Having to enter the ‘tab’ manually like that is a bit of a drag, particularly with more complex geometry. I thought there might be a way of parsing the data without the intermediary step of reformatting it as tab delimited.

          Best Wishes 

          Bonemap 

          http://bonemap.com | Australia
          Izzy STD 4.2 | USB 3.6 | + Beta
          MBP 16” 2019 2.4 GHz Intel i9 64GB AMD Radeon Pro 5500 8 GB 4TB SSD | 14.5 Sonoma
          Mac Studio 2023 M2 Ultra 128GB | OSX 15.3 Sequoia
          A range of deployable older Macs

          1 Reply Last reply Reply Quote 0
          • Michel
            Michel Izzy Guru @bonemap last edited by

            @bonemap 

            The Data Array actor does interpret the numeric coordinates as text because you are connecting it to a text chopper. The outputs default to a numeric value, but are mutable; if you connect the outputs to a text input, it will change to send text instead of numbers. 

            Best Michel

            Michel Weber | www.filmprojekt.ch | rMBP (2019) i9, 16gig, AMD 5500M 8 GB, OS X 10.15 | located in Winterthur Switzerland.

            bonemap 1 Reply Last reply Reply Quote 0
            • bonemap
              bonemap Izzy Guru @Michel last edited by bonemap

              @michel said:

              numeric coordinates as text because you are connecting it to a text chopper

               Thanks Michel, is there an actor that will split the numeric values into the six discrete outputs, similar to what the text chopper is doing only retaining the float format?

              Best WIshes

              bonemap

              http://bonemap.com | Australia
              Izzy STD 4.2 | USB 3.6 | + Beta
              MBP 16” 2019 2.4 GHz Intel i9 64GB AMD Radeon Pro 5500 8 GB 4TB SSD | 14.5 Sonoma
              Mac Studio 2023 M2 Ultra 128GB | OSX 15.3 Sequoia
              A range of deployable older Macs

              1 Reply Last reply Reply Quote 0
              • Juriaan
                Juriaan Tech Staff last edited by

                Hi there @bonemap,

                Just posting this here, perhaps you find it usefull.

                JavaScript Split Example.izz

                Isadora 3.1.1, Dell XPS 17 9710, Windows 10
                Interactive Performance Designer, Freelance Artist, Scenographer, Lighting Designer, TroikaTronix Community moderator
                Always in for chatting about interaction in space / performance design. Drop me an email at hello@juriaan.me

                bonemap 1 Reply Last reply Reply Quote 3
                • bonemap
                  bonemap Izzy Guru @Juriaan last edited by bonemap

                  @juriaan said:

                  perhaps you find it usefull

                   Hi Juriaan,

                  Yes! it solved the issue - you are a gem and it works fantastically. Thanks so much for applying your scripting expertise to my particle challenge. I was starting to look at reading the data file directly with javascript, but your solution is amazing!


                  best wishes

                  bonemap 

                  http://bonemap.com | Australia
                  Izzy STD 4.2 | USB 3.6 | + Beta
                  MBP 16” 2019 2.4 GHz Intel i9 64GB AMD Radeon Pro 5500 8 GB 4TB SSD | 14.5 Sonoma
                  Mac Studio 2023 M2 Ultra 128GB | OSX 15.3 Sequoia
                  A range of deployable older Macs

                  DusX 1 Reply Last reply Reply Quote 0
                  • DusX
                    DusX Tech Staff @Juriaan last edited by

                    @juriaan

                    the numbers are rounded visually but not internally (well JS supports 64bit floats, so they are converted to the nearest 32bit float... thats still very precise).
                    its only that the input fields only display so many decimal places.

                    Troikatronix Technical Support

                    • New Support Ticket Link: https://support.troikatronix.com/support/tickets/new
                    • My Add-ons: https://troikatronix.com/add-ons/?u=dusx
                    • Profession Services: https://support.troikatronix.com/support/solutions/articles/13000109444-professional-services

                    Running: Win 11 64bit, i7, M.2 PCIe SSD's, 32gb DDR4, nVidia GTX 4070 | located in Ontario Canada.

                    1 Reply Last reply Reply Quote 1
                    • DusX
                      DusX Tech Staff @bonemap last edited by

                      @bonemap

                      You can also, load and parse CSV files in Javascript (using a 3rd party JS lib) however... reloading the file is a trick.
                      The JS actor only loads the external file on enterscene. I cheat this by putting it in an User Actor, and switching the User Actor On/Off. This causes the User Actor internals to 'enter Scene'.
                      The lib I have used is: https://www.papaparse.com (use local file method...others use web only JS)

                      Unfortunately I can't find a demo file at the moment.

                      @bonemap how are you extracting the xyz coordinates from the geometries?

                      Troikatronix Technical Support

                      • New Support Ticket Link: https://support.troikatronix.com/support/tickets/new
                      • My Add-ons: https://troikatronix.com/add-ons/?u=dusx
                      • Profession Services: https://support.troikatronix.com/support/solutions/articles/13000109444-professional-services

                      Running: Win 11 64bit, i7, M.2 PCIe SSD's, 32gb DDR4, nVidia GTX 4070 | located in Ontario Canada.

                      bonemap 1 Reply Last reply Reply Quote 1
                      • bonemap
                        bonemap Izzy Guru @DusX last edited by bonemap

                        @dusx said:

                        how are you extracting the xyz coordinates from the geometries

                         Hi @DusX,

                        There is no great mystery about extracting the geometry coordinates - I am using Meshlab, it allows saving the raw data as text file with the extension .xyz. I am just replacing the .xyz extension to .txt in the Finder so that the Data Array actor can access its contents. There is a .json export from Meshlab as well and I had started looking at your javascript tutorials to see if I could make any headway reading the datafile directly with javascript. @Juriaan unsurprisingly beat me to a solution. haha!

                        Best Wishes

                        bonemap

                        http://bonemap.com | Australia
                        Izzy STD 4.2 | USB 3.6 | + Beta
                        MBP 16” 2019 2.4 GHz Intel i9 64GB AMD Radeon Pro 5500 8 GB 4TB SSD | 14.5 Sonoma
                        Mac Studio 2023 M2 Ultra 128GB | OSX 15.3 Sequoia
                        A range of deployable older Macs

                        DusX 1 Reply Last reply Reply Quote 1
                        • DusX
                          DusX Tech Staff @bonemap last edited by

                          @bonemap

                          I think you and I are playing around with similar (but different) types of things these days.
                          I'm feeding xyz values (as Json) all over currently, and was about to look for a way to extract them from geometry, so pointing me at Meshlab is great, thanks.

                          Troikatronix Technical Support

                          • New Support Ticket Link: https://support.troikatronix.com/support/tickets/new
                          • My Add-ons: https://troikatronix.com/add-ons/?u=dusx
                          • Profession Services: https://support.troikatronix.com/support/solutions/articles/13000109444-professional-services

                          Running: Win 11 64bit, i7, M.2 PCIe SSD's, 32gb DDR4, nVidia GTX 4070 | located in Ontario Canada.

                          1 Reply Last reply Reply Quote 1
                          • First post
                            Last post