GithubHelp home page GithubHelp logo

magdesign / mapping-converter Goto Github PK

View Code? Open in Web Editor NEW
2.0 3.0 0.0 366 KB

With this tool you are able to convert .svg output from video mapping softwares like Madmapper or Mapio to PiMapper surfaces

Python 100.00%

mapping-converter's Introduction

mapping-converter

This code is still not finished, but a working one was written in openframeworks available here: https://github.com/magdesign/mapping-converter2

With this tool you are able to convert .svg output from video mapping software like Madmapper, Mapio or Resolume to PiMapper surfaces.
Its not finished yet, but the basic concept works.

##Problems to solve:

  • Dont know how to get the zero points, the quads size is correct, but position not, tryed to add numbers like x value + 960 and y value +540....
  • Define if it is a quad or trianle, surface type="0" is triangle, surface type="1" is quad
  • Any help very welcome..

Here you see the two masks I exported from Madmapper:

alt tag

and here you see how this looks then in PiMapper after converting with this tool:

alt tag

the size looks the same, but the placing... and I guess it eats the content mirrored..

##Instruction

  • Copy parser_one_file.py to a folder.

  • Place a slices.svg (I used an .svg exported from Madmapper) in the same folder as the script.

  • cd into your folder and run: python parser_one_file.py

  • output the .xml file for PiMapper, do something like: python parser_one_file.py > /path/to/file/surfaces.xml

  • Then copy this file to your PiMapper, located somewhere here (depending where you isntalled openframeworks: /home/pi/openFrameworks/addons/ofxPiMapper/example/bin/data/surfaces.xml

Difference between the parser.py and parser_one_file.py, the later is only made for .svg with one quad inside, parser.py is made for more than one quad, and looks for a file called slices2.svg

You might need to install depencies first: pip install svgtools svgpathtools svgwrite

Thanks to turingmachine https://github.com/turingmachine for the help with the basic code.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.