def make_chines(the_hull):

    new_chine = chine_helper.chine_helper(the_hull)

    new_chine.rotation = [0, 0, 0]
    new_chine.offset = [0, 0, 0]
    new_chine.name = "top"
    new_chine.make_chine()

    new_chine.rotation = [25, 0, 0]
    new_chine.offset = [0, 0, -0.5]
    new_chine.name = "mid"
    new_chine.make_chine()

    new_chine.rotation = [-45, 0, 0]
    new_chine.offset = [0, 0, -0.5]
    new_chine.name = "upper"
    new_chine.make_chine()

    new_chine.rotation = [72, 0, 0]
    new_chine.offset = [0, 0, -0.5]
    new_chine.name = "low"
    new_chine.make_chine()

    new_chine.rotation = [90, 0, 0]
    new_chine.offset = [0, 0, 0.3]
    new_chine.name = "roof"
    new_chine.curve_width = -0.4
    new_chine.curve_length = 13
    new_chine.symmetrical = False
    new_chine.make_chine()
示例#2
0
def make_chines():

    new_chine = chine_helper.chine_helper(the_hull)

    new_chine.curve_width = 1
    #    new_chine.curve_height=0.5
    new_chine.curve_length = the_hull.hull_length * 1.2
    new_chine.rotation = [180, 0, 0]
    new_chine.offset = [0, -0.35, -0.5]
    new_chine.name = "side"
    new_chine.make_chine()

    new_chine.rotation = [82, 0, 0]
    new_chine.offset = [0, 0, 0]
    new_chine.name = "low"
    new_chine.curve_length = the_hull.hull_length * 1.4
    new_chine.asymmetry[1] = 0
    new_chine.make_chine()

    new_chine.asymmetry[1] = 0
    new_chine.rotation = [-90, 0, 0]
    new_chine.offset = [0, 0, -0.5]
    new_chine.name = "roof"
    new_chine.curve_width = 0.8
    new_chine.symmetrical = False

    new_chine.make_chine()
示例#3
0
def make_chines():

    new_chine = chine_helper.chine_helper(the_hull)

    new_chine.asymmetry[0] = 1

    new_chine.curve_width = 0.35
    new_chine.longitudal_curve_angle = 40
    new_chine.curve_length = the_hull.hull_length * 2
    #new_chine.curve_angle=23
    new_chine.rotation = [180, 0, 0]
    new_chine.offset = [-.95, 0, 0]
    new_chine.name = "side"
    new_chine.make_chine()

    new_chine.rotation = [82, 0, 0]
    #new_chine.offset=[0,0,0]
    new_chine.name = "low"
    #new_chine.curve_length=the_hull.hull_length*1.4
    #    new_chine.asymmetry[1]=0
    new_chine.make_chine()

    #new_chine.curve_length=the_hull.hull_length*1.1
    new_chine.longitudal_count = 0
    new_chine.rotation = [-36, 0, 0]
    #new_chine.offset=[0.04,0,-0.06]
    new_chine.name = "upper"
    #new_chine.curve_length=the_hull.hull_length*1.3
    new_chine.make_chine()

    new_chine.asymmetry[1] = 0
    new_chine.rotation = [-90, 0, 0]
    new_chine.offset = [.5, 0, 0.6]

    new_chine.curve_width = -0.35
    new_chine.curve_length = the_hull.hull_length * 3

    new_chine.name = "roof"
    new_chine.width = -1
    new_chine.extrude_width = -1
    new_chine.symmetrical = False

    new_chine.make_chine()
示例#4
0
from bpyhullgen.hullgen import hull_maker
from bpyhullgen.hullgen import chine_helper
from bpyhullgen.hullgen import keel_helper
from bpyhullgen.hullgen import render_helper
from bpyhullgen.bpyutils import bpy_helper

performance_timer = bpy_helper.ElapsedTimer()

the_hull=hull_maker.hull_maker(width=3,length=7,height=3)

the_hull.make_hull_object()


new_chine=chine_helper.chine_helper(the_hull,
    name="side",
    length=the_hull.hull_length*1.2,
    width=1,
    rotation=[180,0,0],
    offset=[0,-0.35,-0.5])

the_hull.add_chine(new_chine)


new_chine=chine_helper.chine_helper(the_hull,
    name="low",
    length=the_hull.hull_length*1.4,
    width=1,
    rotation=[82,0,0])

the_hull.add_chine(new_chine)

示例#5
0
def read_hull(filename):

    tree = ET.parse(filename)
    root = tree.getroot()

    newhull=hull_maker.hull_maker(0,0,0)


    for elem in root:

        #================================================================
        if elem.tag=="size":
            newhull.hull_width=parse_float_val(elem,"width",0)
            newhull.hull_length=parse_float_val(elem,"length",0)
            newhull.hull_height=parse_float_val(elem,"height",0)

        #================================================================
        if elem.tag=="materials":
            newhull.structural_thickness=parse_float_val(elem,"structural_thickness",0.1)
            newhull.slicer_overcut_ratio=parse_float_val(elem,"slicer_overcut_ratio",1.1)
            newhull.slot_gap=parse_float_val(elem,"slot_gap",0.1)

        #================================================================
        if elem.tag=="generate":
            newhull.make_bulkheads=parse_int_val(elem,"bulkheads",default=True)
            newhull.make_keels=parse_int_val(elem,"keels",default=True)
            newhull.make_longitudinals=parse_int_val(elem,"longitudinals",default=True)
            newhull.hide_hull=parse_int_val(elem,"hide_hull",default=False)


        #================================================================
        if elem.tag=="bulkheads":

            for bulkhead_elem in elem:
                floor_height=parse_float_val(bulkhead_elem,"floor_height",0)
                watertight=parse_int_val(bulkhead_elem,"watertight",default=True)
                station=parse_float_val(bulkhead_elem,"station",0)
                thickness=parse_float_val(bulkhead_elem,"thickness",0)

                bulkhead_definition=bulkhead.bulkhead_definition(
                    station=station,
                    watertight=watertight,
                    floor_height=floor_height,
                    thickness=thickness)

                newhull.add_bulkhead_definition(bulkhead_definition)

        #================================================================
        if elem.tag=="modshapes":

            for modshape_elem in elem:

                name=parse_str_val(modshape_elem,"name",0)
                mod_type=parse_str_val(modshape_elem,"mod_type","add")
                mod_mode=parse_str_val(modshape_elem,"mod_mode","cube")
                mod_shape=parse_str_val(modshape_elem,"mod_shape","trapezoid")
                symmetrical=parse_int_val(modshape_elem,"symmetrical",default=True)

                size=[0,0,0]
                rotation=[0,0,0]
                location=[0,0,0]
                deform=[0,0,0]

                for subelem in modshape_elem:

                    if subelem.tag=="rotation":
                        rotation[0]=parse_float_val(subelem,"x",0)
                        rotation[1]=parse_float_val(subelem,"y",0)
                        rotation[2]=parse_float_val(subelem,"z",0)

                    if subelem.tag=="location":
                        location[0]=parse_float_val(subelem,"x",0)
                        location[1]=parse_float_val(subelem,"y",0)
                        location[2]=parse_float_val(subelem,"z",0)

                    if subelem.tag=="size":
                        size[0]=parse_float_val(subelem,"x",0)
                        size[1]=parse_float_val(subelem,"y",0)
                        size[2]=parse_float_val(subelem,"z",0)

                    if subelem.tag=="deform":
                        deform[0]=parse_float_val(subelem,"p1",0)
                        deform[1]=parse_float_val(subelem,"p2",0)
                        deform[2]=parse_float_val(subelem,"p3",0)

                modshape=modshape_helper.modshape(
                    name=name,
                    rotation=rotation,
                    location=location,
                    size=size,
                    mod_mode=mod_mode,
                    deform=deform,
                    mod_shape=mod_shape,
                    symmetrical=symmetrical)

                newhull.add_modshape(modshape)

        #================================================================
        if elem.tag=="keels":

            for keel_elem in elem:

                station_start=parse_float_val(keel_elem,"station_start",0)
                station_end=parse_float_val(keel_elem,"station_end",0)
                lateral_offset=parse_float_val(keel_elem,"lateral_offset",0)
                top_height=parse_float_val(keel_elem,"top_height",0)

                keel = keel_helper.keel(newhull,lateral_offset,top_height,station_start,station_end)

                newhull.add_keel(keel)


        #================================================================
        if elem.tag=="chines":

            for chine_elem in elem:

                name=parse_str_val(chine_elem,"name")
                symmetrical=parse_int_val(chine_elem,"symmetrical",default=True)
                length=11
                width=1.2
                height=1.2
                extrude_width=1.2
                
                offset=[0,0,0]
                rotation=[0,0,0]
                asymmetry=[0,0]

                longitudinal_defs=[]

                for subelem in chine_elem:

                    if subelem.tag=="curve":
                        length=parse_float_val(subelem,"length",length)
                        width=parse_float_val(subelem,"width",width)
                        height=parse_float_val(subelem,"height",height)
                        extrude_width=parse_float_val(subelem,"extrude_width",extrude_width)

                    if subelem.tag=="asymmetry":
                        asymmetry[0]=parse_float_val(subelem,"a0",0)
                        asymmetry[1]=parse_float_val(subelem,"a1",0)


                    if subelem.tag=="offset":
                        offset[0]=parse_float_val(subelem,"x",0)
                        offset[1]=parse_float_val(subelem,"y",0)
                        offset[2]=parse_float_val(subelem,"z",0)

                    if subelem.tag=="rotation":
                        rotation[0]=parse_float_val(subelem,"x",0)
                        rotation[1]=parse_float_val(subelem,"y",0)
                        rotation[2]=parse_float_val(subelem,"z",0)

                    if subelem.tag=="longitudinals":

                        for longitudinal_elem in subelem:
                            z_offset=0
                            longitudinal_width=1
                            x_min=-3
                            x_max=3

                            z_offset=parse_float_val(longitudinal_elem,"z_offset",z_offset)
                            longitudinal_width=parse_float_val(longitudinal_elem,"width",width)
                            x_min=parse_float_val(longitudinal_elem,"x_min",x_min)
                            x_max=parse_float_val(longitudinal_elem,"x_max",x_max)

                            longitudinal_definition=chine_helper.longitudinal_definition(
                                width=longitudinal_width,z_offset=z_offset
                            )

                            longitudinal_definition.set_limit_x_length(x_min,x_max)

                            longitudinal_defs.append(longitudinal_definition)


                new_chine=chine_helper.chine_helper(newhull,
                    name=name,length=length,width=width,
                    symmetrical=symmetrical,
                    asymmetry=asymmetry)

                new_chine.curve_height=height
                new_chine.offset=offset
                new_chine.rotation=rotation
                new_chine.extrude_width=extrude_width

                for ld in longitudinal_defs:
                    new_chine.add_longitudinal_definition(ld)

                newhull.add_chine(new_chine)
  
    return newhull
示例#6
0
from bpyhullgen.hullgen import curve_helper
from bpyhullgen.hullgen import hull_maker
from bpyhullgen.hullgen import geometry_helper
from bpyhullgen.hullgen import window_helper
from bpyhullgen.hullgen import keel_helper
from bpyhullgen.bpyutils import bpy_helper
from bpyhullgen.hullgen import render_helper

the_hull = hull_maker.hull_maker(length=11.3, width=3.9, height=3.6)

the_hull.make_hull_object()

new_chine = chine_helper.chine_helper(
    the_hull,
    name="side",
    length=the_hull.hull_length * 1.3,
    width=1,
    rotation=[180, 0, 0],
    offset=[0, 0.06, 0],
)

new_longitudinal = chine_helper.longitudinal_definition(z_offset=0.4,
                                                        width=-0.15,
                                                        thickness=0.05)
new_longitudinal.set_limit_x_length(-4.5, 4.5)
new_chine.add_longitudinal_definition(new_longitudinal)

the_hull.add_chine(new_chine)

#window_helper.make_window_on_chine(new_chine,0.5,0.3)
#window_helper.make_window_on_chine(new_chine,1.5,0.3)
#window_helper.make_window_on_chine(new_chine,-1.5,0.3)
示例#7
0
from bpyhullgen.bpyutils import bpy_helper
from bpyhullgen.hullgen import chine_helper
from bpyhullgen.bpyutils import material_helper
from bpyhullgen.hullgen import curve_helper
from bpyhullgen.hullgen import hull_maker
from bpyhullgen.hullgen import geometry_helper
from bpyhullgen.hullgen import render_helper

the_hull = hull_maker.hull_maker(width=4.7)
the_hull.make_hull_object()

the_hull.bulkhead_count = 0

new_chine = chine_helper.chine_helper(the_hull,
                                      name="wall",
                                      length=the_hull.hull_length,
                                      width=-1,
                                      rotation=[75, 0, 0],
                                      offset=[0, 0.9, 0.3])

new_longitudinal = chine_helper.longitudinal_definition(z_offset=0,
                                                        width=0.6,
                                                        thickness=0.6,
                                                        slicer_ratio=1)

new_longitudinal.set_curve(radius=0.8, angle=4)
new_chine.add_longitudinal_definition(new_longitudinal)

the_hull.add_chine(new_chine)


def not_used():
示例#8
0
#
# ##### END GPL LICENSE BLOCK #####

import bpy

from bpyhullgen.hullgen import chine_helper
from bpyhullgen.hullgen import material_helper
from bpyhullgen.hullgen import curve_helper
from bpyhullgen.hullgen import hull_maker
from bpyhullgen.hullgen import geometry_helper
from bpyhullgen.hullgen import render_helper

the_hull = hull_maker.hull_maker(width=4.7)
the_hull.make_hull_object()

new_chine = chine_helper.chine_helper(the_hull)

new_longitudal = chine_helper.longitudal_element(0, 0.5, 0.3)
new_longitudal.set_curve(radius=0.8, angle=4)
new_longitudal.slicer_ratio = 1

new_chine.add_longitudal_element(new_longitudal)

new_chine.curve_width = -1
new_chine.curve_length = the_hull.hull_length + 0.1

new_chine.rotation = [75, 0, 0]
new_chine.offset = [0, 0.9, 0.3]
new_chine.name = "wall_curve"

new_chine.make_chine()
from bpyhullgen.bpyutils import bpy_helper
from bpyhullgen.hullgen import chine_helper
from bpyhullgen.bpyutils import material_helper
from bpyhullgen.hullgen import curve_helper
from bpyhullgen.hullgen import hull_maker
from bpyhullgen.hullgen import geometry_helper
from bpyhullgen.hullgen import render_helper

the_hull = hull_maker.hull_maker(width=4.7)
the_hull.make_hull_object()

the_hull.bulkhead_count = 0

new_chine = chine_helper.chine_helper(the_hull,
                                      name="wall",
                                      length=the_hull.hull_length,
                                      width=-1,
                                      rotation=[75, 0, 0],
                                      offset=[0, 0.9, 0.3])

new_longitudinal = chine_helper.longitudinal_definition(z_offset=0,
                                                        width=0.5,
                                                        thickness=0.3,
                                                        slicer_ratio=1)

new_chine.add_longitudinal_definition(new_longitudinal)

the_hull.add_chine(new_chine)

new_chine = chine_helper.chine_helper(the_hull,
                                      name="low",
                                      length=the_hull.hull_length,
示例#10
0
from math import radians, degrees

from bpyhullgen.hullgen import chine_helper
from bpyhullgen.bpyutils import material_helper
from bpyhullgen.hullgen import curve_helper
from bpyhullgen.hullgen import hull_maker
from bpyhullgen.hullgen import bulkhead
from bpyhullgen.hullgen import geometry_helper
from bpyhullgen.hullgen import render_helper

the_hull = hull_maker.hull_maker(length=12, width=1, height=0.8)
the_hull.make_hull_object()

new_chine = chine_helper.chine_helper(the_hull,
                                      name="side1",
                                      length=the_hull.hull_length * 1.3,
                                      width=1,
                                      offset=[0, 0, 0],
                                      symmetrical=False)

new_longitudinal = chine_helper.longitudinal_definition(z_offset=-0.2,
                                                        width=-0.4,
                                                        thickness=0.1)
new_longitudinal.set_limit_x_length(-6, 6)
new_chine.add_longitudinal_definition(new_longitudinal)

the_hull.add_chine(new_chine)

new_chine = chine_helper.chine_helper(the_hull,
                                      name="side2",
                                      length=the_hull.hull_length * 1.3,
                                      width=1,
示例#11
0
from bpyhullgen.hullgen import keel_helper
from bpyhullgen.hullgen import render_helper
from bpyhullgen.bpyutils import bpy_helper

from math import radians

the_hull = hull_maker.hull_maker(width=3, length=7, height=3)
the_hull.make_hull_object()

the_hull.start_bulkhead_location = -3
the_hull.hull_output_scale = 1 / 16
the_hull.target_screw_size = 4.1  # mm

new_chine = chine_helper.chine_helper(the_hull,
                                      name="side",
                                      length=the_hull.hull_length * 1.2,
                                      width=1,
                                      offset=[0, 0.35, 0],
                                      asymmetry=[1, 0])

new_longitudinal = chine_helper.longitudinal_definition(z_offset=-0.2,
                                                        width=-0.13,
                                                        thickness=0.1)
new_longitudinal.set_limit_x_length(the_hull.start_bulkhead_location, 2)

new_chine.add_longitudinal_definition(new_longitudinal)

the_hull.add_chine(new_chine)

new_chine = chine_helper.chine_helper(the_hull,
                                      name="upper",
                                      length=the_hull.hull_length * 1.3,
示例#12
0
import bpy

from bpyhullgen.hullgen import chine_helper
from bpyhullgen.bpyutils import material_helper
from bpyhullgen.hullgen import curve_helper
from bpyhullgen.hullgen import hull_maker
from bpyhullgen.hullgen import render_helper

the_hull = hull_maker.hull_maker(length=12, width=5, height=0.8)
the_hull.make_hull_object()

the_hull.bulkhead_count = 0

new_chine = chine_helper.chine_helper(the_hull,
                                      name="side",
                                      length=the_hull.hull_length,
                                      width=-1,
                                      offset=[0, 0.7, 0])

new_longitudinal = chine_helper.longitudinal_definition(z_offset=0,
                                                        width=0.2,
                                                        thickness=0.2)

new_chine.add_longitudinal_definition(new_longitudinal)

the_hull.add_chine(new_chine)

the_hull.integrate_components()

for chine in the_hull.chine_list:
    for chine_instance in chine.chine_instances:
示例#13
0
from bpyhullgen.hullgen import keel_helper
from bpyhullgen.bpyutils import bpy_helper

the_hull=hull_maker.hull_maker(width=5,length=11,height=3)

the_hull.hull_output_scale=1/16
the_hull.target_screw_size=4.1

the_hull.bulkhead_count=9
the_hull.bulkhead_start_location=-4

the_hull.make_hull_object()

new_chine=chine_helper.chine_helper(the_hull,
	name="side",
	length=the_hull.hull_length*1.1,
	width=1.2,
	rotation=[180,0,0],
	offset=[0,-0.27,-0.5])

new_longitudinal=chine_helper.longitudinal_definition(z_offset=-0.3,width=-0.2,thickness=0.1)
new_chine.add_longitudinal_definition(new_longitudinal)
the_hull.add_chine(new_chine)

new_chine=chine_helper.chine_helper(the_hull,
	name="mid",
	length=the_hull.hull_length*1.1,
	width=1.4,
	rotation=[40,0,0],
	offset=[0,-0.2,0.45])

new_chine.add_longitudinal_definition(chine_helper.longitudinal_definition(z_offset=-0.83,width=-0.2,thickness=0.1))
示例#14
0
from bpyhullgen.hullgen import chine_helper
from bpyhullgen.bpyutils import material_helper
from bpyhullgen.hullgen import curve_helper
from bpyhullgen.hullgen import hull_maker
from bpyhullgen.hullgen import bulkhead
from bpyhullgen.hullgen import render_helper
from bpyhullgen.bpyutils import bpy_helper


the_hull=hull_maker.hull_maker()
the_hull.make_hull_object()


new_chine=chine_helper.chine_helper(the_hull,
	name="side",
	length=the_hull.hull_length*1.02,
	width=1.2
	)

the_hull.add_chine(new_chine)

new_chine=chine_helper.chine_helper(the_hull,
	name="mid",
	length=the_hull.hull_length*1.3,
	width=1.2,
	rotation=[25,0,0],
	offset=[0,0,-0.5],
	)

the_hull.add_chine(new_chine)
示例#15
0
#
# ##### END GPL LICENSE BLOCK #####

import bpy

from bpyhullgen.hullgen import hull_maker
from bpyhullgen.hullgen import chine_helper
from bpyhullgen.hullgen import render_helper

the_hull = hull_maker.hull_maker(width=1, length=1.95, height=1)

the_hull.make_hull_object()

new_chine = chine_helper.chine_helper(the_hull,
                                      name="side",
                                      length=the_hull.hull_length * 2.0,
                                      width=0.35,
                                      offset=[-.95, 0, 0],
                                      asymmetry=[1, 0])

the_hull.add_chine(new_chine)

new_chine = chine_helper.chine_helper(the_hull,
                                      name="low",
                                      length=the_hull.hull_length * 2.0,
                                      width=0.35,
                                      offset=[-.95, 0, 0],
                                      asymmetry=[1, 0],
                                      rotation=[82, 0, 0])

the_hull.add_chine(new_chine)