Example #1
0
def make_machine(machine):
    print("boms.py:")
    boms(machine)
    print("sheets.py:")
    sheets(machine)
    print("stls.py:")
    stls(machine)
def accessories(machine, assembly=None):
    assemblies = [
        "raspberry_pi_assembly", "raspberry_pi_camera_assembly",
        "light_strip_assembly", "z_limit_switch_assembly"
    ]
    #
    # Make the target directory
    #
    target_dir = machine + "/stls/accessories"
    if os.path.isdir(target_dir):
        if not assembly:
            shutil.rmtree(
                target_dir)  #if making all of them clear the directory first
            os.makedirs(target_dir)
    else:
        os.makedirs(target_dir)

    if assembly:
        assemblies = [assembly]

    for assembly in assemblies:
        print(assembly)
        bom.boms(machine, assembly)
        stl_list = stls.bom_to_stls(machine, assembly)
        stls.stls(machine, stl_list)
        #
        # Move all the stls that are not in the plates to the plates directory
        #
        for file in stl_list:
            src = machine + "/stls/" + file
            if os.path.isfile(src):
                shutil.move(src, target_dir + "/" + file)
            else:
                print("can't find %s to move" % src)
Example #3
0
def accessories(machine, assembly = None):
    assemblies = ["raspberry_pi_assembly", "raspberry_pi_camera_assembly", "light_strip_assembly" ]

    #
    # Make the target directory
    #
    target_dir = machine + "/stls/accessories"
    if os.path.isdir(target_dir):
        if not assembly:
            shutil.rmtree(target_dir)   #if making all of them clear the directory first
            os.makedirs(target_dir)
    else:
        os.makedirs(target_dir)


    if assembly:
        assemblies = [ assembly ]
    for assembly in assemblies:
        print(assembly)
        bom.boms(machine, assembly)
        stl_list = stls.bom_to_stls(machine, assembly)
        stls.stls(machine, stl_list)
        #
        # Move all the stls that are not in the plates to the plates directory
        #
        for file in stl_list:
            src = machine + "/stls/"+ file
            if os.path.isfile(src):
                shutil.move(src, target_dir + "/" + file)
            else:
                print("can't find %s to move" % src)
Example #4
0
def make_machine(machine):
    print("boms.py:")
    boms(machine)
    print("sheets.py:")
    sheets(machine)
    print("stls.py:")
    stls(machine)
Example #5
0
# NopSCADlib is free software: you can redistribute it and/or modify it under the terms of the
# GNU General Public License as published by the Free Software Foundation, either version 3 of
# the License, or (at your option) any later version.
#
# NopSCADlib is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
# without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along with NopSCADlib.
# If not, see <https://www.gnu.org/licenses/>.
#
#! Generates all the files for a project by running ```bom.py```, ```stls.py```, ```dxfs.py```, ```render.py``` and ```views.py```.

import sys

from exports import make_parts
from bom import boms
from render import render
from views import views
from plateup import plateup

if __name__ == '__main__':
    target = None if len(sys.argv) == 1 else sys.argv[1]
    boms(target)
    for part in ['stl', 'dxf']:
        make_parts(target, part)
        render(target, part)
        plateup(target, part)

    views(target)
Example #6
0
def make_machine(machine):
    boms(machine)
    sheets(machine)
    stls(machine)
    plates(machine)
Example #7
0
def make_machine(machine):
    boms(machine)
    sheets(machine)
    stls(machine)
    accessories(machine)
    plates(machine)
Example #8
0
def make_machine(machine):
    boms(machine)
    sheets(machine)
    stls(machine)
    accessories(machine)
    plates(machine)
def make_machine(machine):
    boms(machine)
    sheets(machine)
    stls(machine)
    plates(machine)
Example #10
0
    main.print_bom(True, open(bom_dir + "/bom.txt", "wt"))

    for ass in sorted(main.assemblies):
        f = open(bom_dir + "/" + ass + ".txt", "wt")
        bom = main.assemblies[ass]
        print >> f, bom.make_name(ass) + ":"
        bom.print_bom(False, f)
        f.close()

    print " done"


if __name__ == '__main__':
    if len(sys.argv) > 1:
        boms(sys.argv[1])
    else:
        print "usage: bom [mendel|sturdy|your_machine]"
        sys.exit(1)

########NEW FILE########
__FILENAME__ = c14n_stl
#!/usr/bin/env python
#
# OpenSCAD produces randomly ordered STL files so source control like GIT can't tell if they have changed or not.
# This scrip orders each triangle to start with the lowest vertex first (comparing x, then y, then z)
# It then sorts the triangles to start with the one with the lowest vertices first (comparing first vertex, second, then third)
# This has no effect on the model but makes the STL consistent. I.e. it makes a canonical form.
#
import sys
Example #11
0
                        main.assemblies[stack[-1]].add_part(s)

    main.print_bom(True, open(bom_dir + "/bom.txt","wt"))

    for ass in sorted(main.assemblies):
        f = open(bom_dir + "/" + ass + ".txt", "wt");
        bom = main.assemblies[ass]
        print >> f, bom.make_name(ass) + ":"
        bom.print_bom(False, f)
        f.close()

    print " done"

if __name__ == '__main__':
    if len(sys.argv) > 1:
        boms(sys.argv[1])
    else:
        print "usage: bom [mendel|sturdy|your_machine]"
        sys.exit(1)

########NEW FILE########
__FILENAME__ = c14n_stl
#!/usr/bin/env python
#
# OpenSCAD produces randomly ordered STL files so source control like GIT can't tell if they have changed or not.
# This scrip orders each triangle to start with the lowest vertex first (comparing x, then y, then z)
# It then sorts the triangles to start with the one with the lowest vertices first (comparing first vertex, second, then third)
# This has no effect on the model but makes the STL consistent. I.e. it makes a canonical form.
#
import sys