コード例 #1
0
import os
from nosecone_library.specific_noses import BNC50J
from bodytubes.semroc import bt20, bt50, bt60
from bodytubes.modelrockets_us import _29mm
from nosecone.nosecone_bases import HollowBaseWithScrewHole

from misc.utils import render_to_file
from transitions import Transition
if __name__=="__main__":
    basedir = os.path.dirname(__file__)
    t=Transition(1.23975, bodytube1=_29mm, bodytube2=bt50, shoulder=.75, thickness = 1/16., bodytube3=bt20, open_end=True, fudge=0.02)
    render_to_file(t.transition, os.path.join(basedir,"bt50t.scad"))
    t=Transition(1.67725, bodytube1=bt60, bodytube2=_29mm, shoulder=.75, thickness = 1/16., bodytube3=bt50, open_end=True)
    render_to_file(t.transition, os.path.join(basedir,"29mmt.scad"))


    nc=BNC50J(thickness=1./16, scale_bodytube=_29mm)
    nc=HollowBaseWithScrewHole(nc, shoulder=0.75, screw_diameter=1 / 16., screw_length=0.25)
    render_to_file(nc.cone, os.path.join(basedir,"bt50n.scad"))
    nc=BNC50J(thickness=1./16, scale_bodytube=bt60)
    nc=HollowBaseWithScrewHole(nc, shoulder=0.75, screw_diameter=1 / 16., screw_length=0.25)
    render_to_file(nc.cone, os.path.join(basedir,"29mmn.scad"))


コード例 #2
0
                            base_height=0.25,
                            blunt_radius=0.125,
                            mid_diameter=.3),
        BluntedConicalNoseCone(0.75,
                               bodytube=bt5,
                               thickness=1 / 16.0,
                               base_height=0.25,
                               blunt_radius=0.125,
                               mid_diameter=.3),
        TangentOgiveNoseCone(0.75,
                             bodytube=bt5,
                             thickness=1 / 16.0,
                             base_height=0.25,
                             blunt_radius=0.125,
                             mid_diameter=.3),
        BluntedTangentOgiveNoseCone(0.75,
                                    bodytube=bt5,
                                    thickness=1 / 16.0,
                                    base_height=0.25,
                                    blunt_radius=0.125,
                                    mid_diameter=.3),
        SecantOgiveNoseCone(0.75,
                            bodytube=bt5,
                            thickness=1 / 16.0,
                            base_height=0.25,
                            blunt_radius=0.125,
                            mid_diameter=.3)
    ])

    utils.render_to_file(array, "examples/standard_nosecones.scad")
コード例 #3
0
from nosecone.nosecone_threaded_bases import ThreadedBaseOutset
from bodytubes import *
from misc import utils


class BNC20B(EllipticalNoseCone):
    def __init__(self, shoulder=0.5, thickness=None, **kwargs):
        super(BNC20B, self).__init__(length=1.7, shoulder=shoulder, bodytube=estes.bt20, thickness=thickness, **kwargs)


class BNC5V(EllipticalNoseCone):
    def __init__(self, shoulder=0.5, thickness=None, **kwargs):
        super(BNC5V, self).__init__(length=0.75, shoulder=shoulder, bodytube=estes.bt5, thickness=thickness, **kwargs)


class BNC50J(EllipticalNoseCone):
    def __init__(self, shoulder=0.5, thickness=None, **kwargs):
        super(BNC50J, self).__init__(length=1.37, shoulder=shoulder, bodytube=estes.bt50, thickness=thickness, **kwargs)

class BNC50K(TangentOgiveNoseCone):
    def __init__(self, shoulder=0.5, thickness=None, **kwargs):
        super(BNC50K, self).__init__(length=2.75, shoulder=shoulder, bodytube=estes.bt50, thickness=thickness, **kwargs)


if __name__ == '__main__':
    # Upscale Mosquito
    utils.render_to_file(ThreadedBaseOutset(BNC5V(thickness=3 / 32., scale_bodytube=loc_precision._3_00), shoulder=1.5).cone,
                         "mos.scad")
    utils.render_to_file(ThreadedBaseOutset(BNC5V(thickness=3 / 32., scale_bodytube=loc_precision._3_00), shoulder=1.5).mate,
                         "mos2.scad")
コード例 #4
0
import os

from bodytubes.modelrockets_us import _3_00
from bodytubes.semroc import bt5, bt2, bt50, bt30, bt55, bt60, bt70, bt80, bt40
from misc import utils
from nosecone.nosecone_bases import HollowBase
from nosecone.nosecone_threaded_bases import ScrewInBase, ThreadedBaseOutsetScrewInBase
from nosecone_library.specific_noses import BNC20B

basedir = os.path.dirname(__file__)

nc = BNC20B(scale_bodytube=bt2, thickness=1 / 16., shoulder=0.5)
nc = HollowBase(nc, shoulder=0.25)
utils.render_to_file(nc.cone,
                     os.path.join(basedir, "nosecones", "bt2_nose.scad"))
nc = BNC20B(scale_bodytube=bt5, thickness=1 / 16., shoulder=0.5)
nc = HollowBase(nc, shoulder=0.375)
utils.render_to_file(nc.cone,
                     os.path.join(basedir, "nosecones", "bt5_nose.scad"))
nc = BNC20B(thickness=1 / 16.)
nc = HollowBase(nc, shoulder=0.5)
utils.render_to_file(nc.cone,
                     os.path.join(basedir, "nosecones", "bt20_nose.scad"))
nc = BNC20B(scale_bodytube=bt30, thickness=1 / 16., shoulder=0.5)
nc = HollowBase(nc, shoulder=0.5625)
utils.render_to_file(nc.cone,
                     os.path.join(basedir, "nosecones", "bt30_nose.scad"))
nc = BNC20B(scale_bodytube=bt40, thickness=1 / 16., shoulder=0.5)
nc = HollowBase(nc, shoulder=0.5625)
utils.render_to_file(nc.cone,
                     os.path.join(basedir, "nosecones", "bt40_nose.scad"))
コード例 #5
0
        if flange_d and flange_t:
            flange = cylinder(h=flange_t, r=flange_d/2.)
        else:
            flange = cylinder(h=height, r=o_r/2.)  # HACK because this will be removed

        self.retainer = difference() (self.threaded_male_column(height, to_mm(retainer_diameter), threads_per_inch) + flange,
                                      cylinder(h=height, r=o_r),
                                      up(height-depth), cylinder(h=depth, r=i_r))
        
        self.cap = difference()(cylinder(h=height,r=c_r),
                                self.threaded_female_column(height-c_t, to_mm(retainer_diameter), threads_per_inch),
                                cylinder(h=height, r=h_r))

        if spine_diameter:
            no_spines = kwargs.get('spines',0)
            spines = []
            for idx in xrange(0, no_spines):
                spines.append(rotate([0,0,360/no_spines*idx])(right(c_r)(cylinder(h=height-c_t-spine_diameter/2, r=spine_diameter/2)+
                                  up(height-c_t-spine_diameter/2)(sphere(r=spine_diameter/2.)))))
            self.cap+=union()(*spines)

        self.round = rotate_extrude()(right(c_r-round_radius)(square([round_radius,round_radius])*circle(round_radius)))
        self.cap -= up(height-round_radius)(rotate_extrude()(right(c_r-round_radius)(square([round_radius,round_radius]))))
        self.cap += up(height-round_radius)(self.round)

from bodytubes.modelrockets_us import _29mm

utils.render_to_file(Retainer(2, 1, depth=.875, bodytube=_29mm, threads_per_inch=6, cap_diameter=2.25, flange_diameter=4, flange_thickness=1 / 16., hole_diameter=.5, cap_thickness=1 / 16., spine_diameter=1 / 8., round_radius=1 / 16., spines=12).retainer, "test.scad")

コード例 #6
0
        self.r3= to_mm(kwargs.get('r3'),safe=True)
        self.r4= to_mm(kwargs.get('r4'),safe=True)
        if bt1:
            self.r1=to_mm(bt1.inner_diameter/2.0)
            self.r2=to_mm(bt1.outer_diameter/2.0)
        if bt2:
            self.r4=to_mm(bt2.inner_diameter/2.0)
            self.r3=to_mm(bt2.outer_diameter/2.0)
        self.shoulder= to_mm(kwargs.get('shoulder'),default=0.5)
        self.shoulder1 = to_mm(kwargs.get('shoulder1'),safe=True)
        self.shoulder2 = to_mm(kwargs.get('shoulder2'),safe=True)
        if self.shoulder1 is None:
            self.shoulder1 = self.shoulder
        if self.shoulder2 is None:
            self.shoulder2 = self.shoulder
        self.height = to_mm(height)
        self.shoulder=to_mm(0.5)
        self.thickness = to_mm(kwargs.get('thickness'),safe=True)
        self.transition = cylinder(h=self.shoulder1, r=self.r1)+up(self.shoulder1+self.height)(cylinder(h=self.shoulder2, r=self.r4))+    up(self.shoulder1)(cylinder(h=self.height, r1=self.r2, r2=self.r3))

        if self.thickness:
            subtract =  cylinder(h=self.shoulder1, r=self.r1-self.thickness)+up(self.shoulder1+self.height)(cylinder(h=self.shoulder2, r=self.r4-self.thickness))+    up(self.shoulder1)(cylinder(h=self.height, r1=self.r2-self.thickness, r2=self.r3-self.thickness))
            self.transition -= subtract

    def render(self):
        return 
    
t=Transition(1, bodytube1=bt50, bodytube2=bt55, shoulder2=1.0, thickness = 1/16.)

render_to_file(t.transition, "test.scad")
コード例 #7
0
""" Generate Examples"""
from nosecone.standard_nosecones import EllipticalNoseCone
from nosecone.nosecone_threaded_bases import *
from nosecone.nosecone_bases import *
from misc import utils
from bodytubes.semroc import bt5


if __name__ == '__main__':

    nc = EllipticalNoseCone(0.75, bodytube=bt5, thickness=1 / 16.0, base_height=0.25, blunt_radius=0.125,
                            mid_diameter=.3)

    array = utils.array_crosssection(4, utils.to_mm(1), [
        ThreadedBaseOutset(nc, shoulder=0.5),
        ThreadedBaseFlat(nc, shoulder=0.5),
        nc.crosssection(ThreadedBaseOutset(nc, shoulder=0.5).mate),
        BaseWithRing(HollowBaseCutout(nc, shoulder=0.5)),

        BaseWithElbow(HollowBaseCutout(nc, shoulder=0.5)),
        SolidBaseCutout(nc, shoulder=0.5),
        HollowBaseCutout(nc, shoulder=0.5),
        SolidBaseWithScrewHole(nc, shoulder=0.5, screw_diameter=1 / 16., screw_length=0.25),
        HollowBaseWithScrewHole(nc, shoulder=0.5, screw_diameter=1 / 16., screw_length=0.25),
        HollowBase(nc, shoulder=0.5),
        OpenBase(nc, shoulder=0.5), SolidBase(nc, shoulder=0.5), NoBase(nc),
    ])
    utils.render_to_file(array, "examples/nosecone_bases.scad")
コード例 #8
0
from solid import multmatrix

from misc import utils
from .nosecone import DerivativeNoseCone
from misc.utils import to_mm


class ShearNoseCone(DerivativeNoseCone):
    def __init__(self, cone, x_shear, y_shear):
        super(DerivativeNoseCone, self).__init__(length=cone.length, thickness=cone.thickness,
                                                 outer_diameter=cone.outer_diameter, inner_diameter=cone.inner_diameter)
        shear_matrix = [[1, 0, x_shear / cone.length, 0],

                        [0, 1, y_shear / cone.length, 0],
                        [0, 0, 1, 0],
                        [0, 0, 0, 1]];
        self.cone = multmatrix(shear_matrix)(cone.cone)


if __name__ == '__main__':
    from standard_nosecones import EllipticalNoseCone, ConicalNoseCone, TangentOgiveNoseCone
    from bodytubes import semroc_bt5 as bt5

    utils.render_to_file(utils.array(2, to_mm(1), [
        ShearNoseCone(EllipticalNoseCone(length=.75, bodytube=bt5, thickness=1 / 16.), .25, .1),
        ShearNoseCone(ConicalNoseCone(length=.75, bodytube=bt5, thickness=1 / 16.), .25, .1),
        ShearNoseCone(ConicalNoseCone(length=.75, bodytube=bt5, thickness=1 / 16.), .25, 0),
        ShearNoseCone(TangentOgiveNoseCone(length=.75, bodytube=bt5, thickness=1 / 16.), .25, 0)]),
                         "examples/shear_nosecones.scad")
コード例 #9
0
from nosecone_library.specific_noses import BNC5V
from bodytubes.semroc import bt20, bt2, bt50, bt30, bt55
from misc import utils
from nosecone.nosecone_bases import HollowBase
import os

basedir = os.path.dirname(__file__)

nc = BNC5V(scale_bodytube=bt2, thickness = 1/16., shoulder=0.5)
nc = HollowBase(nc, shoulder=0.25)
utils.render_to_file(nc.cone, os.path.join(basedir, "nosecones", "bt2_nose.scad"))
nc = BNC5V(thickness = 1/16.)
nc = HollowBase(nc, shoulder=0.5)
utils.render_to_file(nc.cone, os.path.join(basedir, "nosecones", "bt5_nose.scad"))
nc = BNC5V(scale_bodytube=bt20, thickness = 1/16., shoulder=0.5)
nc = HollowBase(nc, shoulder=0.5625)
utils.render_to_file(nc.cone, os.path.join(basedir, "nosecones", "bt20_nose.scad"))
nc = BNC5V(scale_bodytube=bt30, thickness = 1/16., shoulder=0.5)
nc = HollowBase(nc, shoulder=0.5625)
utils.render_to_file(nc.cone, os.path.join(basedir, "nosecones", "bt30_nose.scad"))
nc = BNC5V(scale_bodytube=bt50, thickness = 1/16., shoulder=0.5)
nc = HollowBase(nc, shoulder=0.625)
utils.render_to_file(nc.cone, os.path.join(basedir, "nosecones", "bt50_nose.scad"))
nc = BNC5V(scale_bodytube=bt55, thickness = 1/16., shoulder=0.5)
nc = HollowBase(nc, shoulder=0.75)
utils.render_to_file(nc.cone, os.path.join(basedir, "nosecones", "bt55_nose.scad"))

コード例 #10
0
    from bodytubes.semroc import bt55
    from bodytubes.modelrockets_us import _3_00
    from nosecone_library.specific_noses import BNC5V
    from misc import utils

    nc = EllipticalNoseCone(2.75, bodytube=bt55, thickness=1 / 16.0)
    nc = BNC5V(scale_bodytube=_3_00, thickness=3 / 32.)
    sib = ScrewInBase(nc,
                      shoulder=0.5,
                      thread_height=0.75,
                      thread_diameter=1.2)
    sib = ScrewInBaseWithScrewHole(nc,
                                   shoulder=0.5,
                                   thread_height=0.75,
                                   thread_diameter=1.2,
                                   screw_diameter=1 / 16.,
                                   screw_length=0.25)
    sib = ThreadedBaseOutsetScrewInBase(nc,
                                        shoulder=1.5,
                                        thread_height=1.0,
                                        thread_diameter=2.8)

    array = utils.array(4, to_mm(5), [
        sib.crosssection(),
        nc.crosssection(sib.center_mate),
        nc.crosssection(sib.mate)
    ])
    #ThreadedBaseFlat(nc, shoulder=0.5).cone_section1,
    #        ThreadedBaseFlat(nc, shoulder=0.5).cone_section2])
    utils.render_to_file(array, "test.scad")
コード例 #11
0
        :param inner:
        :param outer:
        :param points:
        :param kwargs:
        Hollow doesn't work quite right yet.
        """
        super(MorphedNoseCone, self).__init__(length, thickness, **kwargs)
        outer = to_mm(outer, self.outer_diameter / 4.)
        inner = to_mm(inner, self.outer_diameter / 8.)
        out = []
        for i in range(0, points):
            alpha = i * 2. * pi / points
            p = polygon([[0, 0], [inner * cos(alpha - pi / points), inner * sin(alpha - pi / points)],
                         [outer * cos(alpha), outer * sin(alpha)],
                         [inner * cos(alpha + pi / points), inner * sin(alpha + pi / points)]])
            out.append(
                MorphedNoseCone(length, p, inner_diameter=self.inner_diameter, outer_diameter=self.outer_diameter,
                                thickness=thickness).cone)
        self.cone = union()(*out)


if __name__ == '__main__':
    from bodytubes.semroc import bt5

    utils.render_to_file(utils.array(2, to_mm(1), [RectangularNoseCone(0.75, bodytube=bt5, thickness=1 / 16.),
                                                   RectangularNoseCone(0.75, bodytube=bt5, width=.1, depth=.25,
                                                                       thickness=1 / 16.),
                                                   EllipseNoseCone(0.75, bodytube=bt5, thickness=1 / 16.),
                                                   StarNoseCone(0.75, bodytube=bt5, thickness=1 / 16.)]),
                         "examples/morphed_nosecone.scad")
コード例 #12
0
        """


''
if __name__ == '__main__':
    from standard_nosecones import EllipticalNoseCone, ConicalNoseCone, TangentOgiveNoseCone
    from bodytubes.semroc import bt5

    utils.render_to_file(
        utils.array(2, to_mm(1), [
            HollowTipNoseCone(
                EllipticalNoseCone(length=.75, bodytube=bt5,
                                   thickness=1 / 16.), .4, 1.),
            HollowTipNoseCone(
                EllipticalNoseCone(length=.75, bodytube=bt5,
                                   thickness=1 / 16.), .4, .75),
            HollowTipNoseCone(
                EllipticalNoseCone(length=.75, bodytube=bt5,
                                   thickness=1 / 16.), .4, .5),
            RamJetNoseCone(
                EllipticalNoseCone(length=.75, bodytube=bt5,
                                   thickness=1 / 16.), .4, 1., .25, .4),
            RamJetNoseCone(
                ConicalNoseCone(length=.75, bodytube=bt5, thickness=1 / 16.),
                .2, 1., .25, .4),
            RamJetNoseCone(
                TangentOgiveNoseCone(length=.75,
                                     bodytube=bt5,
                                     thickness=1 / 16.), .4, 1., .25, .4)
        ]), "examples/hollowtip_nosecones.scad")
コード例 #13
0
                    self.shoulder1 + self.height + self.shoulder2 -
                    self.thickness)(cylinder(h=self.thickness, r=self.r4))
                if bt3:
                    self.transition += cylinder(
                        h=self.shoulder1 + self.height + self.shoulder2,
                        r=to_mm(bt3.outer_diameter / 2.0) + self.thickness)
                    self.transition -= cylinder(
                        h=self.shoulder1 + self.height + self.shoulder2,
                        r=to_mm(bt3.outer_diameter / 2.0) + fudge)

    def render(self):
        return

    def crosssection(self, object=None, angle=0):
        size = (self.height + self.shoulder1 + self.shoulder2 + self.r1) * 2
        if object:
            return object * forward(size / 2)(cube(size, center=True))
        return self.transition * forward(size / 2)(cube(size, center=True))


if __name__ == "__main__":
    t = Transition(1,
                   bodytube1=bt50,
                   bodytube2=bt55,
                   shoulder2=1.0,
                   thickness=1 / 16.,
                   bodytube3=bt20,
                   open_end=True)

    render_to_file(t.crosssection(), "test.scad")