コード例 #1
0
ファイル: wall.py プロジェクト: devonjones/openforge-script
def assemble_wall_back(config, x, segments):
	ops.start()
	split = config['split']
	end_number = 1
	if split:
		end_number = 2
	start_file = ".".join([
		config['columns'][0],
		config['columns'][1],
		"start",
		str(end_number),
		config['columns'][2]])
	start = ops.import_stl(start_file)

	assemble_line(start, config, x, segments, split)

	end_file = ".".join([
		config['columns'][0],
		str(x) + "x",
		config['columns'][1],
		"end",
		str(end_number),
		config['columns'][2]])
	end = ops.import_stl(end_file)

	ops.union(start, end)
	start.select = False
	ops.delete(end)

	ops.print_objects()
	resultfile = "%s.%sx.%s" %(config['result'][0], x, config['result'][1])
	ops.export_stl(start, resultfile)
コード例 #2
0
def assemble_corridor(config, x, y):
    ops.start()
    basefile = "%s%sx%s%s" % (config['base'][0], x, y, config['base'][1])
    base = ops.import_stl(basefile)
    backfile = "%s%sx%s" % (config['back'][0], x, config['back'][1])
    back = ops.import_stl(backfile)
    frontfile = "%s%sx%s" % (config['front'][0], x, config['front'][1])
    front = ops.import_stl(frontfile)

    edge_diff = 10.2
    if config['external']:
        edge_diff = 0.0

    front.location = (0.0, y * 25 - edge_diff, 5.2)
    ops.union(base, front)
    base.select = False
    ops.delete(front)

    edge_diff = 0.0
    if config['external']:
        edge_diff = 12.5

    back.location = (0.0, 0 - edge_diff, 5.2)
    ops.union(base, back)
    base.select = False
    ops.delete(back)

    ops.print_objects()
    base.select = True
    resultfile = "%s%sx%s%s" % (config['result'][0], x, y, config['result'][1])
    ops.export_stl(base, resultfile)
コード例 #3
0
ファイル: wall.py プロジェクト: devonjones/openforge-script
def assemble_wall_back_arb(config, back_length):
	ops.start()
	start_file = ".".join([
		config['columns'][0],
		config['columns'][1],
		"start",
		"2",
		config['columns'][2]])
	start = ops.import_stl(start_file)

	assemble_line_arb(start, config, back_length)

	end_file = ".".join([
		config['columns'][0],
		config['columns'][1],
		"end",
		str(back_length),
		config['columns'][2]])
	end = ops.import_stl(end_file)

	ops.union(start, end)
	start.select = False
	ops.delete(end)

	ops.print_objects()
	resultfile = "%s.%s.%s" %(config['result'][0], back_length, config['result'][1])
	ops.export_stl(start, resultfile)
コード例 #4
0
ファイル: wall.py プロジェクト: m0rgi0n999/openforge-script
def assemble_wall_back(config, x, segments):
    ops.start()
    split = config['split']
    end_number = 1
    if split:
        end_number = 2
    start_file = ".".join([
        config['columns'][0], config['columns'][1], "start",
        str(end_number), config['columns'][2]
    ])
    start = ops.import_stl(start_file)

    assemble_line(start, config, x, segments, split)

    end_file = ".".join([
        config['columns'][0],
        str(x) + "x", config['columns'][1], "end",
        str(end_number), config['columns'][2]
    ])
    end = ops.import_stl(end_file)

    ops.union(start, end)
    start.select = False
    ops.delete(end)

    ops.print_objects()
    resultfile = "%s.%sx.%s" % (config['result'][0], x, config['result'][1])
    ops.export_stl(start, resultfile)
コード例 #5
0
def assemble_corridor(config, x, y):
	ops.start()
	basefile = "%s%sx%s%s" %(config['base'][0], x, y, config['base'][1])
	base = ops.import_stl(basefile)
	backfile = "%s%sx%s" %(config['back'][0], x, config['back'][1])
	back = ops.import_stl(backfile)
	frontfile = "%s%sx%s" %(config['front'][0], x, config['front'][1])
	front = ops.import_stl(frontfile)

	edge_diff = 10.2
	if config['external']:
		edge_diff = 0.0

	front.location = (0.0, y*25-edge_diff, 5.2)
	ops.union(base, front)
	base.select = False
	ops.delete(front)

	edge_diff = 0.0
	if config['external']:
		edge_diff = 12.5

	back.location = (0.0, 0-edge_diff, 5.2)
	ops.union(base, back)
	base.select = False
	ops.delete(back)

	ops.print_objects()
	base.select = True
	resultfile = "%s%sx%s%s" %(config['result'][0], x, y, config['result'][1])
	ops.export_stl(base, resultfile)
コード例 #6
0
ファイル: curved.py プロジェクト: m0rgi0n999/openforge-script
def assemble_c(config, x, y):
	ops.start()
	basefile = "%s%sx%s%s" %(config['base'][0], x, y, config['base'][1])
	base = ops.import_stl(basefile)
	backfile = "%s%sx%s%s" %(config['back'][0], x, y, config['back'][1])
	back = ops.import_stl(backfile)

	back.location = (0.0, 0.0, 5.19)
	ops.union(base, back)
	base.select = False
	ops.delete(back)

	ops.print_objects()
	resultfile = "%s%sx%s%s" %(config['result'][0], x, y, config['result'][1])
	ops.export_stl(base, resultfile)
コード例 #7
0
ファイル: base.py プロジェクト: m0rgi0n999/openforge-script
def add_base(config, x, y):
    ops.start()
    basefile = "%s%sx%s%s" % (config['base'][0], x, y, config['base'][1])
    base = ops.import_stl(basefile)
    tilefile = "%s%sx%s%s" % (config['tile'][0], x, y, config['tile'][1])
    tile = ops.import_stl(tilefile)

    tile.location = (0.0, 0.0, 6.0)
    ops.union(base, tile)
    base.select = False
    ops.delete(tile)

    ops.print_objects()
    resultfile = "%s%sx%s%s" % (config['result'][0], x, y, config['result'][1])
    ops.export_stl(base, resultfile)
コード例 #8
0
ファイル: base.py プロジェクト: devonjones/openforge-script
def add_base(config, x, y):
	ops.start()
	basefile = "%s%sx%s%s" %(config['base'][0], x, y, config['base'][1])
	base = ops.import_stl(basefile)
	tilefile = "%s%sx%s%s" %(config['tile'][0], x, y, config['tile'][1])
	tile = ops.import_stl(tilefile)

	tile.location = (0.0, 0.0, 6.0)
	ops.union(base, tile)
	base.select = False
	ops.delete(tile)

	ops.print_objects()
	resultfile = "%s%sx%s%s" %(config['result'][0], x, y, config['result'][1])
	ops.export_stl(base, resultfile)
コード例 #9
0
def assemble_line(config, x, segments, angle=False):
	start = 'start.1'
	field = 'columns'
	if angle:
		field = 'columns_90'
		start = "start.2"
	start_file = ".".join([
		config[field][0],
		config[field][1],
		start,
		config[field][2]])
	line_start = ops.import_stl(start_file)

	if segments == 0:
		return line_start
	current_segments = segments
	if segments > 4:
		current_segments = 4
	line1_file = ".".join([
		config[field][0],
		"%sx" % current_segments,
		config[field][1],
		"1",
		config[field][2]])
	line1 = ops.import_stl(line1_file)
	ops.union(line_start, line1)
	line_start.select = False
	ops.delete(line1)

	current_segments = segments - 4
	if current_segments <= 0:
		return line_start
	line2_file = ".".join([
		config[field][0],
		"%sx" % current_segments,
		config[field][1],
		"5",
		config[field][2]])
	line2 = ops.import_stl(line2_file)
	if angle:
		line2.location = (0.0, 10.2*4, 0.0)
	else:
		line2.location = (10.2*4, 0.0, 0.0)
	ops.union(line_start, line2)
	line_start.select = False
	ops.delete(line2)

	return line_start
コード例 #10
0
ファイル: wall.py プロジェクト: m0rgi0n999/openforge-script
def assemble_wall(config, x, y):
    ops.start()
    basefile = "%s%sx%s%s" % (config['base'][0], x, y, config['base'][1])
    base = ops.import_stl(basefile)
    backfile = "%s%sx%s" % (config['back'][0], x, config['back'][1])
    back = ops.import_stl(backfile)

    edge_diff = 10.2
    if config['external']:
        edge_diff = 0.0

    back.location = (0.01, y * 25 - edge_diff, 5.19)
    ops.union(base, back)
    base.select = False
    ops.delete(back)

    ops.print_objects()
    resultfile = "%s%sx%s%s" % (config['result'][0], x, y, config['result'][1])
    ops.export_stl(base, resultfile)
コード例 #11
0
ファイル: wall.py プロジェクト: devonjones/openforge-script
def assemble_wall(config, x, y):
	ops.start()
	basefile = "%s%sx%s%s" %(config['base'][0], x, y, config['base'][1])
	base = ops.import_stl(basefile)
	backfile = "%s%sx%s" %(config['back'][0], x, config['back'][1])
	back = ops.import_stl(backfile)

	edge_diff = 10.2
	if config['external']:
		edge_diff = 0.0

	back.location = (0.0, y*25-edge_diff, 5.199)
	ops.union(base, back)
	base.select = False
	ops.delete(back)

	ops.print_objects()
	resultfile = "%s%sx%s%s" %(config['result'][0], x, y, config['result'][1])
	ops.export_stl(base, resultfile)
コード例 #12
0
def assemble_corner_back(config, x, segments):
	ops.start()
	corner_column_file = ".".join([
		config['columns_corner'][0],
		str(x) + "x",
		config['columns_corner'][1]])
	corner = ops.import_stl(corner_column_file)

	back_start = assemble_line(config, x, segments, angle=False)
	side_start = assemble_line(config, x, segments, angle=True)

	thickness = 10.2
	if config['external']:
		thickness = 12.5

	wall_diff = thickness
	if config['external'] and not config['inverse']:
		wall_diff = 0.0
	elif not config['external'] and config['inverse']:
		wall_diff = 0.0
	print("y: %s" % (x*25-wall_diff))
	back_start.location = (0.0, x*25-wall_diff, 0)

	wall_diff = 0.0
	if config['external'] and not config['inverse']:
		wall_diff = thickness
	elif not config['external'] and config['inverse']:
		wall_diff = thickness
	print("x: %s" % (x*25+wall_diff))
	side_start.location = (x*25+wall_diff, 0.0, 0)

	ops.union(corner, back_start)
	ops.union(corner, side_start)
	corner.select = False
	ops.delete(back_start)
	corner.select = False
	ops.delete(side_start)

	ops.print_objects()
	resultfile = "%s.%sx.%s" %(config['result'][0], x, config['result'][1])
	ops.export_stl(corner, resultfile)
コード例 #13
0
ファイル: wall.py プロジェクト: devonjones/openforge-script
def assemble_line(start, config, x, segments, split):
	beginning = "1"
	if split:
		beginning = "5"

	if segments == 0:
		return start
	current_segments = segments
	if segments > 4:
		current_segments = 4
	line1_file = ".".join([
		config['columns'][0],
		"%sx" % current_segments,
		config['columns'][1],
		beginning,
		config['columns'][2]])
	line1 = ops.import_stl(line1_file)
	ops.union(start, line1)
	start.select = False
	ops.delete(line1)

	beginning = "5"
	if split:
		beginning = "1"
	current_segments = segments - 4
	if current_segments <= 0:
		return start
	line2_file = ".".join([
		config['columns'][0],
		"%sx" % current_segments,
		config['columns'][1],
		beginning,
		config['columns'][2]])
	line2 = ops.import_stl(line2_file)
	line2.location = (10.2*4, 0.0, 0.0)
	ops.union(start, line2)
	start.select = False
	ops.delete(line2)

	return start
コード例 #14
0
ファイル: wall.py プロジェクト: m0rgi0n999/openforge-script
def assemble_line_arb(start, config, back_length):
    column_order = config['column_order']

    segments = math.floor(float(back_length) / 10.2) - 1
    if float(back_length) % 10.2 < 3.0:
        segments -= 1

    if segments == 0:
        return start
    current_segments = segments
    for val in range(segments):
        column_file = ".".join([
            config['columns'][0], "1x", config['columns'][1],
            "%s" % (column_order[val]), config['columns'][2]
        ])
        column = ops.import_stl(column_file)
        print("x: %s" % 10.2 * val)
        column.location = (10.2 * val, 0.0, 0.0)
        ops.union(start, column)
        start.select = False
        ops.delete(column)
    return start
コード例 #15
0
ファイル: wall.py プロジェクト: m0rgi0n999/openforge-script
def assemble_line(start, config, x, segments, split):
    beginning = "1"
    if split:
        beginning = "5"

    if segments == 0:
        return start
    current_segments = segments
    if segments > 4:
        current_segments = 4
    line1_file = ".".join([
        config['columns'][0],
        "%sx" % current_segments, config['columns'][1], beginning,
        config['columns'][2]
    ])
    line1 = ops.import_stl(line1_file)
    ops.union(start, line1)
    start.select = False
    ops.delete(line1)

    beginning = "5"
    if split:
        beginning = "1"
    current_segments = segments - 4
    if current_segments <= 0:
        return start
    line2_file = ".".join([
        config['columns'][0],
        "%sx" % current_segments, config['columns'][1], beginning,
        config['columns'][2]
    ])
    line2 = ops.import_stl(line2_file)
    line2.location = (10.2 * 4, 0.0, 0.0)
    ops.union(start, line2)
    start.select = False
    ops.delete(line2)

    return start
コード例 #16
0
ファイル: wall.py プロジェクト: m0rgi0n999/openforge-script
def assemble_wall_back_arb(config, back_length):
    ops.start()
    start_file = ".".join([
        config['columns'][0], config['columns'][1], "start", "2",
        config['columns'][2]
    ])
    start = ops.import_stl(start_file)

    assemble_line_arb(start, config, back_length)

    end_file = ".".join([
        config['columns'][0], config['columns'][1], "end",
        str(back_length), config['columns'][2]
    ])
    end = ops.import_stl(end_file)

    ops.union(start, end)
    start.select = False
    ops.delete(end)

    ops.print_objects()
    resultfile = "%s.%s.%s" % (config['result'][0], back_length,
                               config['result'][1])
    ops.export_stl(start, resultfile)
コード例 #17
0
ファイル: wall.py プロジェクト: devonjones/openforge-script
def assemble_line_arb(start, config, back_length):
	column_order = config['column_order']

	segments = math.floor(float(back_length) / 10.2) - 1
	if float(back_length) % 10.2 < 3.0:
		segments -= 1

	if segments == 0:
		return start
	current_segments = segments
	for val in range(segments):
		column_file = ".".join([
			config['columns'][0],
			"1x",
			config['columns'][1],
			"%s" % (column_order[val]),
			config['columns'][2]])
		column = ops.import_stl(column_file)
		print("x: %s" % 10.2*val)
		column.location = (10.2*val, 0.0, 0.0)
		ops.union(start, column)
		start.select = False
		ops.delete(column)
	return start