#Drive_coupling.dfa - Start
#! UG/KF 17.0
DefClass: drive_coupling (ug_base_part);
(number parameter) horsepower: 4.0;
(number parameter) rpm: 200;
(number parameter) input_shaft_radius: 1.0;
(number parameter) output_shaft_radius: 0.75;
(number parameter) shaft_length: 10;
(number parameter) bolt_diameter: 0.5;
(point parameter) origin: point(0,0,0);
(number) input_shaft_torque: (33000 * horsepower:) / (2 * M_Pi: * rpm:);
(number) length: 2*shaft_length:;
(child) coupling: {
class; if -(input_shaft_radius: = output_shaft_radius:) then
flanged_face_coupling
else if input_shaft_torque: < 100.0 then
keyless_compression_coupling
else
keyed_clamp_coupling;
length; 0.4*shaft_length:;
};
(child) input_shaft: {
class; shaft;
radius; input_shaft_radius:;
length; 1.25 * shaft_length:;
position; origin: - (child:length:/2)*child:direction:;
direction; vector(0,1,0);
color; 5;
};
(child) output_shaft: {
class; shaft;
radius; output_shaft_radius:;
length; 0.75 * shaft_length:;
position; origin: + (child:length:/2)*child:direction:;
direction; vector(0,1,0);
color; 2;
};
#-----------------------------------------------------------------------------
DefClass: flanged_face_coupling (key_mixin flanged_face_mixin);
#-----------------------------------------------------------------------------
DefClass: keyless_compression_coupling (flanged_face_mixin);
(number parameter) sleeve_thickness: 0.5;
(number) inter_flange_spacing: length:/2;
(number) inner_radius_enlargement: .75*sleeve_thickness:;
(child) sleeve: {
class; double_hollow_cone;
inner_radius; input_shaft_radius:;
center_thickness; sleeve_thickness:;
};
#-----------------------------------------------------------------------------
DefClass: keyed_clamp_coupling (key_mixin ug_base_part);
(number) length: 8 * input_shaft_radius:;
(child list) split_half: {
class; split_half;
referenceFrame; if (child:index: = 1) then referenceFrame:
else framexy(point(0,0,0),vector(1,0,0),vector(0,-1,0));
quantity; 2;
};
(child) bolts: {
class; clamp_bolt_group;
};
#-----------------------------------------------------------------------------
DefClass: split_half (ug_base_part);
(number parameter) thickness: 0.5;
(number parameter) flange_height: 1.5;
(number) volume_cost: 0.50;
(number) unit_cost: length: * thickness:;
(child) body: {
class; %cylinder;
inner_radius; input_shaft_radius:;
radius; thickness: + child:inner_radius:;
arc; 180.0;
length; length:;
y_axis; vector(0,0,1);
color; 3;
};
(child list) flange: {
class; %box;
height; thickness:;
length; flange_height:;
width; length:;
position; if (child:index: = 1) then point( body:radius:+child:length:/2,0,-child:height:/2)
else point(-body:radius:-child:length:/2,0,-child:height:/2);
color; 3;
quantity; 2;
};
#-----------------------------------------------------------------------------
DefClass: double_hollow_cone (ug_base_part);
(number parameter) inner_radius: 1.0;
(number parameter) center_thickness: 0.5;
(point parameter) position: point(0,0,0);
(vector parameter) direction: vector(0,1,0);
(number) volume_cost: .025;
(number) unit_cost: 2 * ref(nth(1,cones:),"%cone_body:volume:") * volume_cost:;
(child list) cones: {
class; %cone;
inner_radius_1; inner_radius:;
inner_radius_2; inner_radius:;
radius_1; inner_radius:;
radius_2; inner_radius: + center_thickness:;
length; 4.0;
position; position: + (child:length:/-2)*child:direction:;
direction; if (child:index: = 1)
then direction:
else -1*direction:;
color; 6;
quantity; 2;
};
#-----------------------------------------------------------------------------
DefClass: shaft (ug_base_part);
(number parameter) radius: 1.0;
(number parameter) length: 1.0;
(point parameter) position: point(0,0,0);
(vector parameter) direction: vector(0,0,1);
(integer parameter) color: 2;
(integer parameter) layer: 1;
(number) unit_cost: length: * radius: * .40;
(child) %shaft_feature: {
class; ug_cylinder;
diameter; 2*radius:;
height; length:;
origin; position: - child:height:/2*child:direction:;
direction; direction:;
};
(child) %shaft_body: {
class; ug_body;
feature; {%shaft_feature:};
color; color:;
layer; layer:;
};
#-----------------------------------------------------------------------------
DefClass: clamp_bolt_group (ug_base_part);
(number parameter) bolt_spacing: 3.0;
(number) bolt_pattern_length: length: - 2;
(number) bolt_pattern_width: ref(first(split_half:),"body:radius:") + ref(first(split_half:),"flange_height:")/2;
(integer) n_bolts: floor(bolt_pattern_length: / bolt_spacing:);
(list) bolt_pattern: loop {
for $i from 1 to 2;
for $x is -bolt_pattern_width: then bolt_pattern_width:;
collect loop {
for $j from 1 to n_bolts:;
for $y is -bolt_pattern_length:/2 + ($j-1)*(bolt_pattern_length:/(n_bolts:-1));
collect loop {
for $k from 1 to 2;
for $v is $x
then $y;
collect $v;
};
};
};
(child list) bolts: {
class; bolt_with_cost;
bolt_diameter; bolt_diameter:;
bolt_length; ref(first(split_half:),"thickness:") + ref(last(split_half:),"thickness:");
end_hardware; nut;
position; if (child:index: <= n_bolts:)
then point(first(nth(child:index:,first(bolt_pattern:))),last(nth(child:index:,first(bolt_pattern:))),ref(first(split_half:),"thickness:"))
else point(first(nth(child:index:-n_bolts:,last(bolt_pattern:))),last(nth(child:index:-n_bolts:,last(bolt_pattern:))),ref(first(split_half:),"thickness:"));
y_direction; vector(0,-1,0);
quantity; n_bolts:*2;
};
#-----------------------------------------------------------------------------
DefClass: radial_bolt_group (ug_base_part);
(number) bolt_hole_pattern_radius: radius:-bolt_diameter:-bolt_pattern_from_edge:;
(number) bolt_hole_pattern_circumference: 2 * M_Pi: * bolt_hole_pattern_radius:;
(integer) n_bolt_holes: floor(bolt_hole_pattern_circumference: / (2*bolt_hole_spacing: + bolt_diameter:/2));
(child list) bolts: {
class; bolt_with_cost;
bolt_diameter; bolt_diameter:;
bolt_length; coupling:length: + coupling:inter_flange_spacing:;
end_hardware; nut;
position; ref(first(coupling:flanges:),"%coupling_flange_feature:origin:") +
bolt_hole_pattern_radius:*cos(360/n_bolt_holes:*(child:index:-1))*vector(1,0,0) +
bolt_hole_pattern_radius:*sin(360/n_bolt_holes:*(child:index:-1))*vector(0,0,-1);
y_direction; vector(0,0,-1);
quantity; n_bolt_holes:;
};
#-----------------------------------------------------------------------------
DefClass: bolt_with_cost (bolt);
(number) bolt_cost: bolt_diameter: * .75;
(number) unit_cost: bolt_length: * bolt_cost:;
#Drive_coupling.dfa - End
#bolt.dfa - Start
#! UG/KF 17.0
DefClass: bolt (ug_base_part);
(number parameter) bolt_diameter:1.0;
(number parameter) bolt_length:1.0;
(number parameter) hex_height:0.5;
(name parameter) end_hardware:none;
(point parameter) position:point(0,0,0);
(vector parameter) x_direction:vector(1,0,0);
(vector parameter) y_direction:vector(0,1,0);
(number) hex_flat_width: 1.75*bolt_diameter:;
(number) radius: hex_flat_width: / 2.0 / cos(30.0);
(number) length: if end_hardware: = nut
then bolt_length: + 1.25*hex_height:
else bolt_length:;
(vector) z_direction: x_direction: * y_direction:;
(child list) %lines: {
class; ug_line;
start_point; position: + radius:*cos(60*(child:index:-1))*x_direction: +
radius:*sin(60*(child:index:-1))*y_direction:;
end_point; position: + radius:*cos(60*child:index:)*x_direction: +
radius:*sin(60*child:index:)*y_direction:;
suppress?; true;
quantity; 6;
};
(child) %extrusion: {
class; ug_extruded;
profile; %lines:;
end_limit; hex_height:;
direction; -1 * z_direction:;
};
(child) %upper_cone: {
class; ug_cone;
base_diameter; hex_flat_width: + (2*hex_height:/tan(30));
top_diameter; 0;
height; hex_height: + hex_flat_width: * tan(30)/2;
origin; position:;
direction; -1 * z_direction:;
};
(child) %lower_cone: {
class; ug_cone;
base_diameter; hex_flat_width: + (2*hex_height:/tan(30));
top_diameter; 0;
height; hex_height: + hex_flat_width: * tan(30)/2;
origin; position: + -1*hex_height:*z_direction:;
direction; z_direction:;
};
(child) %shaft: {
class; ug_cylinder;
diameter; bolt_diameter:;
height; length:;
origin; position:;
direction; z_direction:;
};
(child) %bool1: {
class; ug_boolean;
operation; intersect;
tool; {%upper_cone:};
target; {%extrusion:};
};
(child) %bool2: {
class; ug_boolean;
operation; intersect;
tool; {%lower_cone:};
target; {%bool1:};
};
(child) %bool3: {
class; ug_boolean;
operation; unite;
tool; {%shaft:};
target; {%bool2:};
};
(child) %body: {
class; ug_body;
feature; {%bool3:};
color; 4;
};
(child) nut: {
class; if end_hardware: = nut then nut else nulldesign;
bolt_diameter; bolt_diameter:;
hex_height; hex_height:;
position; position: + length:*z_direction:;
x_direction; x_direction:;
y_direction; y_direction:;
};
#bolt.dfa - End
#box.dfa - Start
#! UG/KF 17.0
DefClass: %box (ug_base_part);
(number parameter) height: 1.0;
(number parameter) length: 1.0;
(number parameter) width: 1.0;
(point parameter) position: point(0,0,0);
(vector parameter) x_axis: vector(1,0,0);
(vector parameter) y_axis: vector(0,1,0);
(integer parameter) color: 2;
(integer parameter) layer: 1;
(vector) %z_axis: x_axis: * y_axis:;
(point) %box_pos: position: - height:/2*%z_axis: - width:/2*y_axis: - length:/2*x_axis:;
(Child) %box_feature: {
class; ug_block;
height; height:;
length; length:;
width; width:;
x_axis; x_axis:;
y_axis; y_axis:;
origin; %box_pos:;
};
(child) %box_body: {
class; ug_body;
feature; {%box_feature:};
color; color:;
layer; layer:;
};
#box.dfa - End
#cone.dfa - Start
#! UG/KF 17.0
DefClass: %cone (ug_base_part);
(number parameter) inner_radius_1: 1.0;
(number parameter) inner_radius_2: 1.0;
(number parameter) radius_1: 1.0;
(number parameter) radius_2: 1.5;
(number parameter) length: 1.0;
(point parameter) position: point(0,0,0);
(vector parameter) direction: vector(0,0,1);
(integer parameter) color: 2;
(integer parameter) layer: 1;
(Child) %cone_feature: {
class; if (radius_1: = radius_2:) then ug_cylinder else ug_cone;
diameter; 2*radius_1:;
base_diameter; 2*radius_1:;
top_diameter; 2*radius_2:;
height; length:;
origin; position: - child:height:/2*child:direction:;
direction; direction:;
};
(Child) %cone_hollow: {
class; if (inner_radius_1: = 0.0) | (inner_radius_2: = 0.0) then nulldesign
else if (inner_radius_1: = inner_radius_2:) then ug_cylinder
else ug_cone;
diameter; 2*inner_radius_1:;
base_diameter; 2*inner_radius_1:;
top_diameter; 2*inner_radius_2:;
height; length:;
origin; position: - child:height:/2*child:direction:;
direction; direction:;
operation; subtract;
target; {%cone_feature:};
};
(child) %cone_body: {
class; ug_body;
feature; {%cone_feature:};
color; color:;
layer; layer:;
};
#cone.dfa - End
#Cylinder.dfa - Start
#! UG/KF 17.0
DefClass: %cylinder (ug_base_part);
(number parameter) inner_radius: 0.0;
(number parameter) radius: 1.0;
(number parameter) length: 1.0;
(number parameter) arc: 360;
(point parameter) position: point(0,0,0);
(vector parameter) x_axis: vector(1,0,0);
(vector parameter) y_axis: vector(0,1,0);
(integer parameter) color: 2;
(integer parameter) layer: 1;
(frame) %cyl_frm: framexy(position:,x_axis:,y_axis:);
(vector) %cyl_dir: x_axis: * y_axis:;
(point) %cyl_pos: position:;
(Child) %cyl_arc: {
class; ug_arc;
radius; radius:;
start_angle; 180;
end_angle; child:start_angle: + arc:;
center; %cyl_pos:;
x_axis; x_axis:;
y_axis; y_axis:;
suppress?; true;
};
(Child) %cyl_line1: {
class; if (arc: = 360.0) then nulldesign else ug_line;
start_point; %cyl_arc:center: + %cyl_arc:radius:*vector_(cos(%cyl_arc:end_angle:),sin(%cyl_arc:end_angle:),0,%cyl_frm:);
end_point; %cyl_arc:center:;
suppress?; true;
};
(Child) %cyl_line2: {
class; if (arc: = 360.0) then nulldesign else ug_line;
start_point; %cyl_arc:center:;
end_point; %cyl_arc:center: + %cyl_arc:radius:*vector_(cos(%cyl_arc:start_angle:),sin(%cyl_arc:start_angle:),0,%cyl_frm:);
suppress?; true;
};
(Child) %cyl_feature: {
class; ug_extruded;
start_limit; -length:/2;
end_limit; length:/2;
profile; if (arc: = 360.0) then {%cyl_arc:} else {%cyl_arc:,%cyl_line1:,%cyl_line2:};
direction; %cyl_dir:;
};
(Child) %cyl_hollow: {
class; if (inner_radius: = 0.0) then nulldesign else ug_cylinder;
diameter; 2*inner_radius:;
height; length:;
origin; %cyl_pos:-(length:/2)*%cyl_dir:;
direction; %cyl_dir:;
operation; subtract;
target; {%cyl_feature:};
};
(child) %cyl_body: {
design; ug_body;
feature; {%cyl_feature:};
color; color:;
layer; layer:;
};
#Cylinder.dfa -End
#flanged_face_mixin.dfa - Start
#! UG/KBE 17.0
DefClass: flanged_face_mixin (ug_base_part);
(number parameter) length: 1.0;
(number parameter) radius: 8.0;
(number parameter) inner_radius_enlargement: 0.0;
(number parameter) bolt_hole_spacing: 3.0;
(number parameter) bolt_pattern_from_edge: 1.0;
(number) width: 2*radius:;
(number) height: 2*radius:;
(number) inter_flange_spacing: 0.0;
(child list) flanges: {
class; coupling_flange;
radius; radius:;
length; length:/2;
inner_radius; if child:index: = 1
then input_shaft_radius: + inner_radius_enlargement:
else output_shaft_radius: + inner_radius_enlargement:;
position; if child:index: = 1
then point (0,-child:length:/2-inter_flange_spacing:/2,0)
else point (0, child:length:/2+inter_flange_spacing:/2,0);
direction; if child:index: = 1
then vector(0, 1,0)
else vector(0,-1,0);
color; 3;
quantity; 2;
};
(child) bolts: {
class; radial_bolt_group;
};
DefClass: coupling_flange (ug_base_part);
(number parameter) radius: 1.0;
(number parameter) inner_radius: 0.0;
(number parameter) length: 1.0;
(point parameter) position: point(0,0,0);
(vector parameter) direction: vector(0,0,1);
(integer parameter) color: 2;
(integer parameter) layer: 1;
(number) unit_cost: radius: * .85;
(child) %coupling_flange_feature: {
class; ug_cylinder;
diameter; 2*radius:;
height; length:;
origin; position: - child:height:/2*child:direction:;
direction; direction:;
};
(child) %coupling_flange_hole: {
class; if inner_radius: > 0.0 then ug_cylinder else nulldesign;
diameter; 2*inner_radius:;
height; length:;
origin; position: - child:height:/2*child:direction:;
direction; direction:;
operation; subtract;
target; {%coupling_flange_feature:};
};
(child) %coupling_flange_body: {
class; ug_body;
feature; {%coupling_flange_feature:};
color; color:;
layer; layer:;
};
#flanged_face_mixin.dfa - End
#key_mixin.dfa - Start
#! UG/KBE 17.0
DefClass: key_mixin (ug_base_part);
(number parameter) length: 1.0;
(number parameter) key_extension: 1.0;
(child list) keys: {
class; key;
length; length:/2 + key_extension:;
height; if child:index: = 1
then input_shaft_radius:
else output_shaft_radius:;
width; child:height:/2;
position; if child:index: = 1
then point(0,-child:length:/2,2/3*child:height:)
else point(0, child:length:/2,2/3*child:height:);
color; 6;
quantity; 2;
};
DefClass: key (ug_base_part);
(number parameter) length: 1.0;
(number parameter) height: 1.0;
(number parameter) width: 1.0;
(point parameter) position: point(0,0,0);
(integer parameter) color: 2;
(integer parameter) layer: 1;
(number) volume_cost: .12;
(number) unit_cost: volume_cost: * %key_body:volume:;
(child) %key_feature: {
class; ug_block;
length; width:;
height; height:;
width; length:;
origin; position: - vector(child:length:/2,child:width:/2,child:height:/2);
};
(child) %key_body: {
class; ug_body;
feature; {%key_feature:};
color; color:;
layer; layer:;
};
#key_mixin.dfa - End
#nut.dfa - Start
#! UG/KF 17.0
DefClass: nut (ug_base_part);
(number parameter) bolt_diameter:1.0;
(number parameter) hex_height:0.5;
(point parameter) position:point(0,0,0);
(vector parameter) x_direction:vector(1,0,0);
(vector parameter) y_direction:vector(0,1,0);
(number) hex_flat_width: 1.75*bolt_diameter:;
(number) radius: hex_flat_width: / 2.0 / cos(30.0);
(vector) z_direction: x_direction: * y_direction:;
(child list) %lines: {
class; ug_line;
start_point; position: + radius:*cos(60*(child:index:-1))*x_direction: +
radius:*sin(60*(child:index:-1))*y_direction:;
end_point; position: + radius:*cos(60*child:index:)*x_direction: +
radius:*sin(60*child:index:)*y_direction:;
suppress?; true;
quantity; 6;
};
(child) %extrusion: {
class; ug_extruded;
profile; %lines:;
end_limit; hex_height:;
direction; -1 * z_direction:;
};
(child) %upper_cone: {
class; ug_cone;
base_diameter; hex_flat_width: + (2*hex_height:/tan(30));
top_diameter; 0;
height; hex_height: + hex_flat_width: * tan(30)/2;
origin; position:;
direction; -1 * z_direction:;
};
(child) %lower_cone: {
class; ug_cone;
base_diameter; hex_flat_width: + (2*hex_height:/tan(30));
top_diameter; 0;
height; hex_height: + hex_flat_width: * tan(30)/2;
origin; position: + -1*hex_height:*z_direction:;
direction; z_direction:;
};
(child) %hole: {
class; ug_cylinder;
diameter; bolt_diameter:;
height; hex_height:;
origin; position:;
direction; -1 * z_direction:;
};
(child) %bool1: {
class; ug_boolean;
operation; intersect;
tool; {%upper_cone:};
target; {%extrusion:};
};
(child) %bool2: {
class; ug_boolean;
operation; intersect;
tool; {%lower_cone:};
target; {%bool1:};
};
(child) %bool3: {
class; ug_boolean;
operation; subtract;
tool; {%hole:};
target; {%bool2:};
};
(child) %body: {
class; ug_body;
feature; {%bool3:};
color; 4;
};
#nut.dfa - End
카페 게시글
검색이 허용된 게시물입니다.
답글
수정
삭제
스팸처리
다음검색