Esempio n. 1
0
def add_pilot_house():
    bpy.ops.mesh.primitive_cube_add(size=1.0, location=(0, 0, 0.27))

    bpy.ops.transform.resize(value=(1, 0.9, 1))
    bpy.ops.object.transform_apply(scale=True, location=False)

    ob = bpy.context.active_object

    ob.name = "Pilot House"

    bpy.ops.object.mode_set(mode='EDIT')

    bpy.ops.mesh.select_all(action='DESELECT')
    bpy.ops.object.mode_set(mode='OBJECT')

    for face in ob.data.polygons:
        face.select = geometry_helper.GoingUp(face.normal)

    bpy.ops.object.mode_set(mode='EDIT')

    bpy.ops.transform.resize(value=(1, 0.6, 1))

    bpy.ops.transform.translate(value=(-0.4, 0, 0))

    bpy.ops.mesh.bevel(offset=0.1)

    bpy.ops.object.mode_set(mode='OBJECT')

    bool_new = the_hull.hull_object.modifiers.new(type="BOOLEAN",
                                                  name="hull_join")
    bool_new.object = ob
    bool_new.operation = 'UNION'

    bpy_helper.hide_object(ob)
Esempio n. 2
0
def add_extras():
    # ================ Add Rudder
    bpy.ops.mesh.primitive_cube_add(size=1.0, location=(-4.6, 0, -1.05))

    rudder_object = bpy.context.active_object

    rudder_object.name = "Rudder"

    bpy.ops.transform.resize(value=(0.7, 0.10, 0.8))
    bpy.ops.object.transform_apply(scale=True, location=False)

    bool_new = the_hull.hull_object.modifiers.new(type="BOOLEAN",
                                                  name="hull_join")
    bool_new.object = rudder_object
    bool_new.operation = 'UNION'

    bpy_helper.hide_object(rudder_object)

    # ================ Add Keel
    bpy.ops.mesh.primitive_cube_add(size=1.0, location=(-1.9, 0, -1.05))

    ob = bpy.context.active_object

    ob.name = "Keel"

    bpy.ops.transform.resize(value=(3.8, 0.10, 0.8))
    bpy.ops.object.transform_apply(scale=True, location=False)

    bool_new = the_hull.hull_object.modifiers.new(type="BOOLEAN",
                                                  name="hull_join")
    bool_new.object = ob
    bool_new.operation = 'UNION'

    bpy_helper.hide_object(ob)
Esempio n. 3
0
def add_deck_cockpit(the_hull):
	# ================ Deck Cockpit
	bpy.ops.mesh.primitive_cube_add(size=1.0, location=(  -2.5, 0, 0) )

	bpy.ops.transform.resize(value=(1.5,1,0.7))
	bpy.ops.object.transform_apply(scale=True,location=False)

	ob = bpy.context.active_object
	ob.name="Deck Cockpit"

	bool_new = the_hull.hull_object.modifiers.new(type="BOOLEAN", name="hull_cut")
	bool_new.object = ob
	bool_new.operation = 'DIFFERENCE'

	bpy_helper.hide_object(ob)
Esempio n. 4
0
def add_window(the_hull):
	# ================ Add Window
	bpy.ops.mesh.primitive_cube_add(size=1.0, location=(  -.7, 0, 0.35) )

	bpy.ops.transform.resize(value=(2.2,0.5,0.3))
	bpy.ops.object.transform_apply(scale=True,location=False)

	ob = bpy.context.active_object
	ob.name="Windows"

	bool_new = the_hull.hull_object.modifiers.new(type="BOOLEAN", name="hull_cut")
	bool_new.object = ob
	bool_new.operation = 'DIFFERENCE'

	bpy_helper.hide_object(ob)
Esempio n. 5
0
def add_extras():
    # ================ Add Rudder
    bpy.ops.mesh.primitive_cube_add(size=1.0, location=(-5.3, 0, -1.25))

    rudder_object = bpy.context.active_object

    rudder_object.name = "Rudder"

    bpy.ops.transform.resize(value=(0.7, 0.05, 0.8))
    bpy.ops.object.transform_apply(scale=True, location=False)

    bool_new = the_hull.hull_object.modifiers.new(type="BOOLEAN",
                                                  name="hull_join")
    bool_new.object = rudder_object
    bool_new.operation = 'UNION'

    bpy_helper.hide_object(rudder_object)

    # ================ Add Keel
    bpy.ops.mesh.primitive_cube_add(size=1.0, location=(-1.2, 0, -1.25))

    ob = bpy.context.active_object

    ob.name = "Keel"

    bpy.ops.transform.resize(value=(7, 0.05, 0.8))
    bpy.ops.object.transform_apply(scale=True, location=False)

    bool_new = the_hull.hull_object.modifiers.new(type="BOOLEAN",
                                                  name="hull_join")
    bool_new.object = ob
    bool_new.operation = 'UNION'

    bpy_helper.hide_object(ob)

    # ================ Add deck cockpit
    bpy.ops.mesh.primitive_cube_add(size=1.0, location=(-2.2, 0, 0))

    ob = bpy.context.active_object

    ob.name = "deck_cockpit"

    bpy.ops.transform.resize(value=(3, 1, 1))
    bpy.ops.object.transform_apply(scale=True, location=False)

    bool_new = the_hull.hull_object.modifiers.new(type="BOOLEAN",
                                                  name="hull_cut")
    bool_new.object = ob
    bool_new.operation = 'DIFFERENCE'

    bpy_helper.hide_object(ob)
Esempio n. 6
0
# ================ Add Rudder
bpy.ops.mesh.primitive_cube_add(size=1.0, location=(-5.3, 0, -1.25))

rudder_object = bpy.context.active_object

rudder_object.name = "Rudder"

bpy.ops.transform.resize(value=(0.7, 0.05, 0.8))
bpy.ops.object.transform_apply(scale=True, location=False)

bool_new = the_hull.hull_object.modifiers.new(type="BOOLEAN", name="hull_join")
bool_new.object = rudder_object
bool_new.operation = 'UNION'

bpy_helper.hide_object(rudder_object)

# ================ Add Keel
bpy.ops.mesh.primitive_cube_add(size=1.0, location=(-1.2, 0, -1.25))

ob = bpy.context.active_object

ob.name = "Keel"

bpy.ops.transform.resize(value=(7, 0.05, 0.8))
bpy.ops.object.transform_apply(scale=True, location=False)

bool_new = the_hull.hull_object.modifiers.new(type="BOOLEAN", name="hull_join")
bool_new.object = ob
bool_new.operation = 'UNION'
Esempio n. 7
0
ob = bpy.context.active_object

ob.name = "deck_cockpit"

tail_cut_angle = 22

bpy.ops.transform.resize(value=(1, 1, 2))
bpy.ops.object.transform_apply(scale=True, location=False)
bpy.ops.transform.rotate(value=radians(tail_cut_angle), orient_axis='Y')

bool_new = the_hull.hull_object.modifiers.new(type="BOOLEAN", name="hull_cut")
bool_new.object = ob
bool_new.operation = 'DIFFERENCE'

bpy_helper.hide_object(ob)


def add_pilot_house():
    # ================ Add Pilot House
    bpy.ops.mesh.primitive_cube_add(size=1.0, location=(1, 0, 0.27))

    bpy.ops.transform.resize(value=(2, 0.9, 1.5))
    bpy.ops.object.transform_apply(scale=True, location=False)

    ob = bpy.context.active_object

    ob.name = "Pilot House"

    bpy.ops.object.mode_set(mode='EDIT')