Search code examples
bash3dtexture-mappingcommand-line-interface

Any CLI tool to perform 3d texture mapping on the fly


I'm currently looking for a way to create a 'configurator' for a upholsters, similar to http://digitaldraping.com/configurator/furniture-sofa/?Cushions_Plain-Cream.png,Sofa_Stripe-Orange.png - you select your fabrics and they are 'drawn' on the sofa automatically.

Unfortunately, all the sites I've looked at seem to use pre-rendered transparent PNGs that are overlaid over each other to build up the full picture. The problem here is that we've figured out that we'd require over 120,000 different images to cover all models, fabrics etc!!

I've looked at a few 3d texture tools such as http://www.arahne.si/products/arah-drape.html, hoping that one of them would have a CLI option where you give it a pre-created wireframe, and a fabric to overlay, and it generates the required image on the fly, but so far everything seems to require real-time use of the GUI to use it.

So, is there a CLI tool that would do what I'm after, or can anyone suggest a way to manipulate the GUI automatically? (from a tech point of view, I'm comfortable with C, Bash, Python or PHP as a solution!)

Thanks!


Solution

  • ArahDrape 2.2 can now work from a command line without any GUI interface. You can also call ArahDrape as a C library. In this way, it can be used in a web server to create texture mapped images on the fly. The command line options are explained below.

    ArahDrape 2.2j command line version, ©2015 Arahne
    usage:
    adCommand -o /tmp/outputImage.png -tN /home/user/texture.png [-hidemodel] [-divide 2] [-filterPNG] [-compressPNG 2] [-m /home/user/model.png] -owner name -activation 174b3cfb49e9 /home/user/project.drape
    Input and output images can have png, .tif or .jpg extensions
    -o output_image_file 
    -tN texture_image_file   [N goes from 0 to 199]
    -hidemodel will render all areas not in region as white
    -divide N    [N goes from 2 to 5] divide resulting image pixel size
    -filterPNG    if you do not filter it, rendering is faster
    -compressPNG N    [N goes from 0 to 9] lower number saves faster, but bigger files
    -m model_image_file    use this if you want to replace model image from the project; must have same pixel size
    -owner owner_name   pass the given owner name
    -activation activation_code   pass the given activation code
    last parameter should be ArahDrape project file
    All files should be entered with full path.
    If you need spaces in filenames, use quotes "" around the filename.
    If you provide only Owner name, without activation code, program returns registration code.