my question centers on how one encapsulates yet still manages to assemble a
set of subassemblies into a final assembly.
to add more clarification:
my imagination of good encapsulation is that all data for a given part is
stored within a subassembly. Including its attachment points to whatever
subassembly it attaches to.
Now...if i desire to use code to put all these subassemblies together I need
to get at the attachment points within a subassembly....but i can not figure
out how to do that.
One might believe that if one creates a hierarchical arrangement of
subassemblies, the subassembly of higher abstraction (the assembly to which
a subassembly will be attached) would know exactly where the attachment
points are...but....I do not know where my subassembly attachment points are
to result in proprer mating.
How do you guys do this with code?
thank you
Bil
--
View this message in context: http://forum.openscad.org/assemble-process-question-tp14497.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
An OpenSCAD program doesn't have the concept of multiple objects.
You could create multiple solids in the rendering space, with different
colors etc, but they are also just (disjointed) parts of the one object.
Another handicap is that there's no object/solid variable so you can't
create a data structure with a solid and some data (such as reference
or attachment point coordinates).
One highly imperfect solution I use is to put each object into a separate
program with the object generated in a module and its data (attachment
points, dimensions, movement range etc) into variables. And an
"assembly.scad" which include<> each module and move, rotate each
object into the proper place using the data from each include.
--
View this message in context: http://forum.openscad.org/assemble-process-question-tp14497p14498.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
I represent sub assemblies with modules that draw a bunch of objects by
calling other modules that may be smaller sub assemblies, printed parts or
vitamins like screws. Then a top level module draws the complete assembly.
I don't have a concept of connection points. I just give each part a
sensible origin and orientation to make them easy to place. If more
information is need I export it with functions with names prefixed by the
name of the object they relate to.
On Nov 15, 2015 3:38 AM, "ctchin" c.t.chin@szu.edu.cn wrote:
An OpenSCAD program doesn't have the concept of multiple objects.
You could create multiple solids in the rendering space, with different
colors etc, but they are also just (disjointed) parts of the one object.
Another handicap is that there's no object/solid variable so you can't
create a data structure with a solid and some data (such as reference
or attachment point coordinates).
One highly imperfect solution I use is to put each object into a separate
program with the object generated in a module and its data (attachment
points, dimensions, movement range etc) into variables. And an
"assembly.scad" which include<> each module and move, rotate each
object into the proper place using the data from each include.
--
View this message in context:
http://forum.openscad.org/assemble-process-question-tp14497p14498.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
First and foremost..thank you for responding. I am grateful.
I am trying to understand you. I am slow..please be patient. Allow me to
say what you said in my own words ..and if I am not understanding you,
please correct me. My goal is to understand you not be "right" or anything.
Here is what I hear you say:
. You encapsulate each object, just as I suggested, in separate
blah.scad files.
. You "include" all those files into an "assembly" file. "Including"
places all the code AND the variables you defined in the included file
within the assembly file.
. Thus the "assembly" file somehow (I am not clear on how) has access
to the attachment information within each included file and so the assembly
file code can rotate, translate or do whatever is necessary to line each
object to one another.
So..I am guessing that the attachment data within each included file is
defined as a special variable so that it can always be seen (though never
changed.which is perfectly acceptable for my specific situation) by the
assembly file.
Have I understood you?
bil
From: ctchin [via OpenSCAD] [mailto:ml-node+s1091067n14498h54@n5.nabble.com]
Sent: Saturday, November 14, 2015 10:38 PM
To: whburling whburling@outlook.com
Subject: Re: assemble process question
An OpenSCAD program doesn't have the concept of multiple objects.
You could create multiple solids in the rendering space, with different
colors etc, but they are also just (disjointed) parts of the one object.
Another handicap is that there's no object/solid variable so you can't
create a data structure with a solid and some data (such as reference
or attachment point coordinates).
One highly imperfect solution I use is to put each object into a separate
program with the object generated in a module and its data (attachment
points, dimensions, movement range etc) into variables. And an
"assembly.scad" which include<> each module and move, rotate each
object into the proper place using the data from each include.
If you reply to this email, your message will be added to the discussion
below:
http://forum.openscad.org/assemble-process-question-tp14497p14498.html
To unsubscribe from assemble process question, click here
<http://forum.openscad.org/template/NamlServlet.jtp?macro=unsubscribe_by_cod
e&node=14497&code=d2hidXJsaW5nQG91dGxvb2suY29tfDE0NDk3fDU4Njc0MDk4NA==> .
<http://forum.openscad.org/template/NamlServlet.jtp?macro=macro_viewer&id=in
stant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-
nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamesp
ace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21na
bble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml> NAML
--
View this message in context: http://forum.openscad.org/assemble-process-question-tp14497p14543.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
Thank you for replying .much appreciated.
Here are bits that I pulled from your response:
· A top level module draws the complete assy
· I dont have a concept of connection points.
· You give each part a sensible origin and orientation to make it
easy to place
· If you need more information, you move it out of a module via a
function (which can return data).
If I misunderstood you, then please correct me.
If my understanding is correct, then I have the following two questions:
· Regarding your comment: I give each object a sensible origin and
orientation.
I am confused. I cant figure out how to move the origin where I want it to
be. If I could move the origin within each module, then I could move it to
the effective center of the attachment point .
Thus the module that assembles all the other modules knows that when each is
called it at least knows the attachment point will always be at the current
origin. It will not have orientation information, however, as the module
being attached has no clue about any other module and hence desired
orientation is unknown.
Its orientation is another matter.
You suggested a function. If I understood you, then somehow
I can tell a function which module to enter to get the data a module needs
to attach another module to it.
I do not know how to tell a function how to enter another module
bil
From: nophead [via OpenSCAD]
[mailto:ml-node+s1091067n14504h40@n5.nabble.com]
Sent: Sunday, November 15, 2015 5:24 AM
To: whburling whburling@outlook.com
Subject: Re: assemble process question
I represent sub assemblies with modules that draw a bunch of objects by
calling other modules that may be smaller sub assemblies, printed parts or
vitamins like screws. Then a top level module draws the complete assembly. I
don't have a concept of connection points. I just give each part a sensible
origin and orientation to make them easy to place. If more information is
need I export it with functions with names prefixed by the name of the
object they relate to.
On Nov 15, 2015 3:38 AM, "ctchin" <[hidden email]> wrote:
An OpenSCAD program doesn't have the concept of multiple objects.
You could create multiple solids in the rendering space, with different
colors etc, but they are also just (disjointed) parts of the one object.
Another handicap is that there's no object/solid variable so you can't
create a data structure with a solid and some data (such as reference
or attachment point coordinates).
One highly imperfect solution I use is to put each object into a separate
program with the object generated in a module and its data (attachment
points, dimensions, movement range etc) into variables. And an
"assembly.scad" which include<> each module and move, rotate each
object into the proper place using the data from each include.
--
View this message in context:
http://forum.openscad.org/assemble-process-question-tp14497p14498.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
If you reply to this email, your message will be added to the discussion
below:
http://forum.openscad.org/assemble-process-question-tp14497p14504.html
To unsubscribe from assemble process question, click here
<http://forum.openscad.org/template/NamlServlet.jtp?macro=unsubscribe_by_cod
e&node=14497&code=d2hidXJsaW5nQG91dGxvb2suY29tfDE0NDk3fDU4Njc0MDk4NA==> .
<http://forum.openscad.org/template/NamlServlet.jtp?macro=macro_viewer&id=in
stant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-
nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamesp
ace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21na
bble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml> NAML
--
View this message in context: http://forum.openscad.org/assemble-process-question-tp14497p14546.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
Consider a stepper motor. I make a module to draw it and I use translate to
make the origin in the middle of the front face (at the base of the shaft)
and I use rotate to orientate it so the shaft points upwards. So if I just
call the module the motor would appear at the world origin.
Then when I use it in an assembly (say a z motor assembly) I know exactly
where to place it relative to the bracket. I might need to dimension the
bracket to be the right size and have the correct hole for the motor boss
and the correct screw holes, so I have functions in the same file as the
motor to return these values.
The origin of the motor assembly is most natural in the middle of the base
of the motor as that rests on the base of the machine, so in the assembly I
would transfer the motor upwards by its length.
So there are no functions describing connection points programmatically,
just conventions where the origin is. That could be expressed by comments
if necessary but in a lot of cases it is obvious where the origin should be
for easiest placement. For example screws have the origin where they meet
the surface of the material so you don't need to no anything about the head
to place them and of course they point down.
For an example look at mendel90 on github as that is a complex assembly
with many sub assemblies. It is a complete machine right down to the level
of nuts an bolts with everything modelled apart from the wiring.
On Nov 16, 2015 5:21 PM, "whburling" whburling@outlook.com wrote:
Thank you for replying….much appreciated.
Here are bits that I pulled from your response:
· A top level module draws the complete assy
· I don’t have a concept of connection points.
· You give each part a sensible origin and orientation to make it
easy to place
· If you need more information, you move it out of a module via a
function (which can return data).
If I misunderstood you, then please correct me.
If my understanding is correct, then I have the following two questions:
· Regarding your comment: “I give each object a sensible origin
and orientation”.
I am confused. I can’t figure out how to move the origin where I want it
to be. If I could move the origin within each module, then I could move
it to the effective center of the attachment point .
Thus the module that assembles all the other modules knows that when each
is called it at least knows the attachment point will always be at the
current origin. It will not have orientation information, however, as the
module being attached has no clue about any other module and hence desired
orientation is unknown.
Its orientation is another matter.
You suggested a function. If I understood you, then
somehow I can tell a function which module to enter to get the data a
module needs to attach another module to it.
I do not know how to tell a function how to enter another module……
bil
From: nophead [via OpenSCAD] [mailto:[hidden email]
http:///user/SendEmail.jtp?type=node&node=14546&i=0]
Sent: Sunday, November 15, 2015 5:24 AM
To: whburling <[hidden email]
http:///user/SendEmail.jtp?type=node&node=14546&i=1>
Subject: Re: assemble process question
I represent sub assemblies with modules that draw a bunch of objects by
calling other modules that may be smaller sub assemblies, printed parts or
vitamins like screws. Then a top level module draws the complete assembly.
I don't have a concept of connection points. I just give each part a
sensible origin and orientation to make them easy to place. If more
information is need I export it with functions with names prefixed by the
name of the object they relate to.
On Nov 15, 2015 3:38 AM, "ctchin" <[hidden email]
http:///user/SendEmail.jtp?type=node&node=14504&i=0> wrote:
An OpenSCAD program doesn't have the concept of multiple objects.
You could create multiple solids in the rendering space, with different
colors etc, but they are also just (disjointed) parts of the one object.
Another handicap is that there's no object/solid variable so you can't
create a data structure with a solid and some data (such as reference
or attachment point coordinates).
One highly imperfect solution I use is to put each object into a separate
program with the object generated in a module and its data (attachment
points, dimensions, movement range etc) into variables. And an
"assembly.scad" which include<> each module and move, rotate each
object into the proper place using the data from each include.
--
View this message in context:
http://forum.openscad.org/assemble-process-question-tp14497p14498.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
OpenSCAD mailing list
[hidden email] http:///user/SendEmail.jtp?type=node&node=14504&i=1
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
OpenSCAD mailing list
[hidden email] http:///user/SendEmail.jtp?type=node&node=14504&i=2
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
If you reply to this email, your message will be added to the discussion
below:
http://forum.openscad.org/assemble-process-question-tp14497p14504.html
To unsubscribe from assemble process question, click here.
NAML
http://forum.openscad.org/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml
View this message in context: RE: assemble process question
http://forum.openscad.org/assemble-process-question-tp14497p14546.html
Sent from the OpenSCAD mailing list archive http://forum.openscad.org/
at Nabble.com.
OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
On 17/11/15 07:50, nop head wrote:
Consider a stepper motor. I make a module to draw it and I use
translate to make the origin in the middle of the front face (at the
base of the shaft) and I use rotate to orientate it so the shaft
points upwards. So if I just call the module the motor would appear at
the world origin.
Then when I use it in an assembly (say a z motor assembly) I know
exactly where to place it relative to the bracket. I might need to
dimension the bracket to be the right size and have the correct hole
for the motor boss and the correct screw holes, so I have functions in
the same file as the motor to return these values.
The origin of the motor assembly is most natural in the middle of the
base of the motor as that rests on the base of the machine, so in the
assembly I would transfer the motor upwards by its length.
That was my 'Eureka' moment designing a stepper motor application, and
realising that I needed to get the core part of its function (the motor
spindle) aligned into the simplest build position (centered on an axis)
with the other parts (geared body and mounting brackets) around it.....
and then move the whole lot into position after that. I also designed
the mounting holes and pulleys along the same process, to be later
positioned exactly as the motor was and know that the "difference"
mounting holes were going to work!!
eg.... (as a Newbie I hope this not too trivial, or badly written, but
making my design visually tangible, and conveniently modularised was a
huge help to me progressing...)
$fn=20;
motor();
//motormount();
module motor(){ //Stepper motor "28BY-J-48"
color("Goldenrod"){
translate([0,0,5]) cylinder(10,2.5,2.5,true);//spindle
translate([0,0,0.5]) cylinder(1,4.5,4.5,true);//spindle base
translate([0,7.5,0]){
translate([0,0,-10]) cylinder(20,14,14,true); //body of motor
difference(){
translate([0,0,-0.5]) cube([42,7,1],true); //bracket
translate([17,0,-1]) cylinder(5,d=4.5,true);//mount hole
translate([-17,0,-1]) cylinder(5,d=4.5,true);//mount hole
}
}
translate([0,0,10]) pulley();
}
}
module motormount(){
translate([0,0,3]) cylinder(7,4.5,4.5,true);//spindle base
translate([17.5,7.5,-1]) cylinder(7,d=2,true);//mount hole
translate([-17.5,7.5,-1]) cylinder(7,d=2,true);//mount hole
translate([0,0,-1]) cylinder(15,d=16,true);//gear cutaway
}
module pulley(){
difference(){
union(){
translate([0,0,-5]) cylinder(8,7,7,true);//main outside
translate([0,0,1]) cylinder(4.1,7,7,true);//main outside
//ring for O-ring, eg out of the 'click' hose fittings???
translate([0,0,5 ]){
cylinder(4,7,3.5,true);
cylinder(4,3.5,7,true);
}
}
translate([0,0,2]) cylinder(22,2.6,2.6,true);//inner shaft hole
translate([0,0,-9]) cylinder(2,5,5,true);//Motor base shaft hole
translate([0,0,-3.5]) rotate([270,0,0])
cylinder(10,d=2.5,true);//hole for bolt, taps to a 6BA Bolt
}
translate([0,-2.5,0.4]) cube([7,1.5,13.0],true);//flat inside
}
Rob
So there are no functions describing connection points
programmatically, just conventions where the origin is. That could be
expressed by comments if necessary but in a lot of cases it is obvious
where the origin should be for easiest placement. For example screws
have the origin where they meet the surface of the material so you
don't need to no anything about the head to place them and of course
they point down.
For an example look at mendel90 on github as that is a complex
assembly with many sub assemblies. It is a complete machine right down
to the level of nuts an bolts with everything modelled apart from the
wiring.
On Nov 16, 2015 5:21 PM, "whburling" <whburling@outlook.com
mailto:whburling@outlook.com> wrote:
Thank you for replying….much appreciated.
Here are bits that I pulled from your response:
·A top level module draws the complete assy
·I don’t have a concept of connection points.
·You give each part a sensible origin and orientation to make it
easy to place
·If you need more information, you move it out of a module via a
function (which can return data).
If I misunderstood you, then please correct me.
If my understanding is correct, then I have the following two
questions:
·Regarding your comment: “I give each object a sensible origin and
orientation”.
I am confused. I can’t figure out how to move the origin where I
want it to be.If I could move the origin within each module, thenI
could move it to the effective center of the attachment point .
Thus the module that assembles all the other modules knows that
when each is called it at least knows the attachment point will
always be at the current origin. It will not have orientation
information, however, as the module being attached has no clue
about any other module and hence desired orientation is unknown.
Its orientation is another matter.
You suggested a function.If I understood you, then somehow I can
tell a function which module to enter to get the data a module
needs to attach another module to it.
I do not know how to tell a function how to enter another module……
bil
*From:*nophead [via OpenSCAD] [mailto:[hidden email]
<http:///user/SendEmail.jtp?type=node&node=14546&i=0>]
*Sent:* Sunday, November 15, 2015 5:24 AM
*To:* whburling <[hidden email]
<http:///user/SendEmail.jtp?type=node&node=14546&i=1>>
*Subject:* Re: assemble process question
I represent sub assemblies with modules that draw a bunch of
objects by calling other modules that may be smaller sub
assemblies, printed parts or vitamins like screws. Then a top
level module draws the complete assembly. I don't have a concept
of connection points. I just give each part a sensible origin and
orientation to make them easy to place. If more information is
need I export it with functions with names prefixed by the name of
the object they relate to.
On Nov 15, 2015 3:38 AM, "ctchin" <[hidden email]
<http:///user/SendEmail.jtp?type=node&node=14504&i=0>> wrote:
An OpenSCAD program doesn't have the concept of multiple objects.
You could create multiple solids in the rendering space, with
different
colors etc, but they are also just (disjointed) parts of the
one object.
Another handicap is that there's no object/solid variable so
you can't
create a data structure with a solid and some data (such as
reference
or attachment point coordinates).
One highly imperfect solution I use is to put each object into
a separate
program with the object generated in a module and its data
(attachment
points, dimensions, movement range etc) into variables. And an
"assembly.scad" which include<> each module and move, rotate each
object into the proper place using the data from each include.
--
View this message in context:
http://forum.openscad.org/assemble-process-question-tp14497p14498.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
_______________________________________________
OpenSCAD mailing list
[hidden email]
<http:///user/SendEmail.jtp?type=node&node=14504&i=1>
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
_______________________________________________
OpenSCAD mailing list
[hidden email] <http:///user/SendEmail.jtp?type=node&node=14504&i=2>
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
------------------------------------------------------------------------
*If you reply to this email, your message will be added to the
discussion below:*
http://forum.openscad.org/assemble-process-question-tp14497p14504.html
To unsubscribe from assemble process question, click here.
NAML
<http://forum.openscad.org/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
------------------------------------------------------------------------
View this message in context: RE: assemble process question
<http://forum.openscad.org/assemble-process-question-tp14497p14546.html>
Sent from the OpenSCAD mailing list archive
<http://forum.openscad.org/> at Nabble.com.
_______________________________________________
OpenSCAD mailing list
Discuss@lists.openscad.org <mailto:Discuss@lists.openscad.org>
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
whburling, your understanding is almost perfect.
So in blah.scad:
A more involved version, allowing for parametrization:
And nophead's advice is perfectly good. I always follow a similar practice
in my design, e.g.
http://www.thingiverse.com/thing:1060061
The blad.scad approach is only needed when a project or group of projects
need to share and re-use parts.
--
View this message in context: http://forum.openscad.org/assemble-process-question-tp14497p14590.html
Sent from the OpenSCAD mailing list archive at Nabble.com.