Welcome to machinehub

Contents:

machinehub

Todo

TODO

Getting started

Todo

TODO

Create a folder with the name hello_world and save all the following files inside.

Open FreeCAD and create a new document.

_images/gs_001.png

Create a cube.

_images/gs_002.png

Save the document as hello.fcstd.

_images/gs_003.png

You can navigate the Cube info, for example, change the Cube Label to “hello_cube”.

_images/gs_004.png

You can see all the editable paramaterers in the python terminal.

_images/gs_005.png

Save the project.

_images/gs_006.png

Create a machine script hello_world.py.

import sys
FREECADPATH = '/usr/lib/freecad/lib/'
sys.path.append(FREECADPATH)
import FreeCAD
import Mesh
import os


def machinebuilder(length, width, height, file_path):

    document = os.path.abspath("hello.fcstd")
    #-- Open document
    doc = FreeCAD.openDocument(document)

    #-- Edit parameters
    cube = None
    for figure in doc.Objects:
        if figure.Label == 'hello_cube':
            cube = figure
    if cube:
        cube.Length = length
        cube.Height = height
        cube.Width = width
        doc.recompute()

         #-- Export the file
        Mesh.export([cube], file_path)

and a machinefile.txt

[doc]
-title-
Hello World Cube
-description-
A simple CUbe
-images_url-
http://d33y93cfm0wb4z.cloudfront.net/coloringimages/3D_shapes/444x271/cube_447x271.jpg
[inputs]
int(length=50)
float(width=50)
int(height=50)

Now, you should have a folder tree like the following.

hello_world/
├── hello.fcstd
├── hello_world.py
└── machinefile.txt

Create a hello_world.zip file with all the files and Upload the machine.

How to use a machine

Todo

TODO

Create you first machine

Todo

TODO

How to update a machine

Todo

TODO

Getting started

Todo

TODO

Release notes

Todo

TODO

Developer Zone

Installation

System dependencies

Install FreeCAD.
# Install FreeCAD
sudo add-apt-repository ppa:freecad-maintainers/freecad-stable
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install freecad freecad-doc
Install Docker.
# Install Docker
sudo apt-get install wget
wget -qO- https://get.docker.com/ | sh
Create a Docker group.

Warning

Warning: The docker group is equivalent to the root user.

# Create a Docker group
sudo usermod -aG docker YOUR_USER_NAME
Python requirements
cd machinehub
sudo -H pip install -r requirements.txt

Execute machinehub

Build the machinehub docker image to use as base to the machine images.

cd machinehub/machinehub/docker/
docker build -t machinehub .

Launch the webapp.

cd machinehub
python launcher.py

Configure machinehub

If you want to change the address or the admin info, edit ~/.machinehub/machinehub.conf yo chage the address, port, or the admin info.

[server]
host: 127.0.0.1
port: 5000
[users]
admin: admin #user: password

Try Machinehub

localhost:5000

_images/home.png

localhost:5000/upload

_images/upload.png

Select all the machine .zip files.

_images/files.png

Clic in the blue upload button and machinehub will redirect your browser to the home page with the machines. loaded

_images/uploaded.png