On 2 January 2017 at 10:33, Marijan Pollak oberonmp@gmail.com wrote:
Thanks for clarification. So how can I signal from module what it has done?
I tried to access imaga that is defined in main program in Module but
until
I put it as parameter, it was not recognized.
Global variables are definitely accessible in modules and functions.
cube_size = 10;
function the_cube_size() = cube_size;
module my_cube() {
echo(the_cube_size());
cube(cube_size);
}
color("red")
my_cube();
color("green")
translate([20, 0, 0])
rotate([45, 0, 0])
my_cube();
ECHO: 10
ECHO: 10
Are Functions different?
No.
Unfortunately what someone made as three way Puzlecut do not work.
I guess I have to export File after first cut and Import it before next.
Undfortunately Export is not there for some obscure reason.
It is never necessary to export and object and re-import it into the same
script. That is the main reason export does not exist. The example above
shows the geometry created by my_cube() can be reused and it is cached, so
only computed once,
I would have to find source of Editor and clone that function to export
.stl file
and make new Module Export ("filename.stl"), or can You do it for all of
us that
need such thing?
I believe somebody already did that but it was rejected.
So far I find Compiler unpredictable and not explaining errors, which
mostly
happen someplace in the Library.
Yes error reporting is not one of its strong points.
I also do not know where to put ";" at end of
command or module call and where it is forbidden. I decided to put it
everywhere
but sometimes it cause errors?
It marks the end of a statement, so it is critical where it should be. If
you look at
color("green")
translate([20, 0, 0])
rotate([45, 0, 0])
my_cube();
That is all one statement, so it needs one semicolon at the end. If you put
one say after color() you would get two statements. The first would colour
nothing and the translate would start a new statement so you would get an
uncoloured cube that was just rotated and translated.
Perhaps some more time and I would catch rules, I start by doing sipmple
things,
like creating plate and cutting it, and when I would have that Module
ready, I can
build up on that plate something more complicated, cut this and so on.
If you re not alreday familiar with curly brace languages like C then you
need to read and understand the OpenSCAD manual:
https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/The_OpenSCAD_Language#Chapter_1_--_General
Unfortunately I am half blind and did not do much programming, mostly I
was using
GFA32 Basic, which is not OO Language, but then Open SCAD is not either.
I would need to have access to STL file parameters as well as come
rudimentary
CFD program and then I would be able to make it do all calculations in
paralel and
export results as file that can then be corelated to Stl File parameters
and Cfd
parameters to find out which parameters produce better result.
Than thing can be "Evolved" to best possible solution or parameters. It is
possible
to Cross bred several existing solutions and get something entirely new.
Regards, Marijan Pollak
On Sun, Jan 1, 2017 at 7:16 PM, nop head nop.head@gmail.com wrote:
Firstly statements are not executed as such. They build a tree structure
of geometric primitives and boolean operations. The boolean operations can
be done in any order as long as the operands (which are lower branches in
the tree) have been computed first. So yes things on the right are lower
nodes on the tree and must be computed first. And yes, compound statements
like union() that can span many lines will compute all the things lower in
the tree before the union is computed.
Secondly, OpenSCAD has lexical scope, very much the same as C, so a
variable (which are actually named constants) defined in one module cannot
be accessed in a another. But you can define constants at file level scope,
so if you move imaga=1 outside the Cuts module it will be accessible in
osnova. Or you can declare it as a parameter of osnova and pass it each
time you call it.
On 1 January 2017 at 17:25, Marijan Pollak oberonmp@gmail.com wrote:
Hi, I did not know the difference exist. It may be true that it is
parsed top to bottom, but somehow I
found that what is on the bottom of Module is executed first, then line
up and each line is executed right to left.
There is Example:
module Cuts(){
imaga=1 // Last of all , program is notified that file exist and
need not to be drawn again
//Here cut object has to be exported
;
angleMaleCut(cut = yCut1); // Then male cut is made
angleMaleCut(cut = yCut2);
angleMaleCut(cut = yCut3);
translate ([0,0,0]); // It is aligned to center line
osnova(); // again clone or duplicate
is imported or drawn
angleFemaleCut(cut = yCut1); // then female cuts are made
angleFemaleCut(cut = yCut2);
angleFemaleCut(cut = yCut3);
translate ([-15,0,0]); // It is then moved 15mm on
Xcoordinate
Rotate (0,120,0,); // Second, iti s rotated in y
on horizontal plane
osnova(); // First, .stl file is
Imported or drawn
}
//
module osnova()
{//"scadturbine.stl
echo("Object to cut=",objekt, "ima =", imaga);
if(imaga == 0){drawObject();}
else {import(objekt);}
}
in case there is more then one instruction on one line, they are
executed rightmost first
then left neigbour one by one .
That is consistent with bottom to top execution.
I shall check again by puting some ECHO commands
However, since Imaga =1; is first command If program would work normal
way,
then ECHO would not report Zero in module osnova.
Ups!
.It seems that variables from program were not passed to Module unless
explicitely mentioned in Module
Parameter lists,which means I cannot change value in Module to be
generally available at new state?
Maxbe those multiple instractions were permutable without change of
result?
So how to do it? must put imaga = imaga, in Module parameter list?
Or something else?
Sincerely, Marijan Pollak
On Sun, Jan 1, 2017 at 3:37 PM, nop head nop.head@gmail.com wrote:
Note this is OpenSCAD. Open SCADA is a different, unrelated, project.
I also wonder why is everything in this programming script upside down
and rightside left.
I don't know what you mean. The Syntax and layout are similar to C and
is parsed top to bottom, left to right.
Was this originally made by Chinese?
No, Austrians.
On 1 January 2017 at 08:07, Marijan Pollak oberonmp@gmail.com wrote:
Hello colagues, I noted there is no way to Export .stl file except by
hand,
while Import is working. IMHO, it should be easy to make new Module
ExportStl() by finding same function in Editor. Since I am New to Open
Scada, can some seasoned SCADA programmer do it?
I also wonder why is everything in this programming script upside down
and
rightside left
as compared to other Programming Languages? Was this originally made by
Chinese?
If I have time I would turn this to normal, as well as make it faster,
this
seems awfully slow
for just few simple Objects added or subtracted one from another.
I really need such parametric 3D drawing program as in 3D Max I cannot
position things precisely by hand. I am inventor whose inventions
would save
the World, so by helping me You would help Yourself also.
What I am trying to do at moment is to find way to cut large objects
symetrically like by Puzzlecut, to be able to 3D print pieces of large
objects on small 3D printer, I.E. 25 x 25 cm
pieces of 100 cm diameter objects. I tried to attach the picture here
but
script hanged up, so this time I would try to do it separately....
Thanks in advance and I wish You all Healthy, Happy anf Prosperous
2017!
--
View this message in context: http://forum.openscad.org/Expo
rt-Stl-File-module-tp19829.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
--
Regards from Croatia, the Homeland of one of greatest inventors from
19th and 20th Centuries, Engineer Nikola Tesla!
OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
--
Regards from Croatia, the Homeland of one of greatest inventors from 19th
and 20th Centuries, Engineer Nikola Tesla!
OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Thank You Very Kindly!
I suppose I can generate whole turbine by generating 1/ 3 of points and
making Extrude,
then rotating object 120 degtees and repeating or just cutting that out
with Puzzlecut and
joining 3 pieces after they are printed on 3D printer..... Can I draw on
surface of cylinder
and then Extrude2D to get one joined object, or this has to be made
separate object first?
So, I must experiment.... Is there a way to build 3D object that way?
Same, there would be many points anyhow, so many lines in .txt file.
How do I signal to program that next line is continuation of points?
I also suppose that last point should be first?
or I can draw using primitives like line or circle? I would like to use
Rotate Extrude and also make
Welds. I suppose once I extrude this form to 3D I have to save object
created, after which I can
Join or subtract some primitives like from any other Objects imported?
I hope that Cheat Sheet would be informative enough, I shall check.
On Sun, Jan 1, 2017 at 10:50 PM, Ronaldo Persiano rcmpersiano@gmail.com
wrote:
Pollak,
Except in cases of heavy and complex models, you should not be concerned
about avoiding to rebuild a "clone" in OpenSCAD. The system keeps computed
models and values in cache so its reuse doesn't require reevaluations.
About your turbine design code: in principle, you have two alternatives;
one is to compute the profiles through an OpenSCAD code generating points
and passing them to a polygon() or polyhedron(); or change the code of your
external profile generator in order to produce its output as a text file of
the form:
points = [ [...], [...], ...];
This text file is then made part of your OpenSCAD code with:
use <profile_points.txt>
at its beginning.
Ronaldo
OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
--
Regards from Croatia, the Homeland of one of greatest inventors from 19th
and 20th Centuries, Engineer Nikola Tesla!
Ok, Module can see Global Variable but it cannot change itts value.
However if there is local variable with same name, i.e kerf in the
Puzzlecut then I must write kerf=kerf in module parameter list,
and I find some modules have kerf=0 as parameter which is
confusing me, as it seems not used in that module MaleCut,
but someplace else, outside of Puzzlecut.Lib
On Mon, Jan 2, 2017 at 12:48 PM, nop head nop.head@gmail.com wrote:
On 2 January 2017 at 10:33, Marijan Pollak oberonmp@gmail.com wrote:
Thanks for clarification. So how can I signal from module what it has
done?
I tried to access imaga that is defined in main program in Module but
until
I put it as parameter, it was not recognized.
Global variables are definitely accessible in modules and functions.
cube_size = 10;
function the_cube_size() = cube_size;
module my_cube() {
echo(the_cube_size());
cube(cube_size);
}
color("red")
my_cube();
color("green")
translate([20, 0, 0])
rotate([45, 0, 0])
my_cube();
ECHO: 10
ECHO: 10
Are Functions different?
No.
Unfortunately what someone made as three way Puzlecut do not work.
I guess I have to export File after first cut and Import it before next.
Undfortunately Export is not there for some obscure reason.
It is never necessary to export and object and re-import it into the same
script. That is the main reason export does not exist. The example above
shows the geometry created by my_cube() can be reused and it is cached, so
only computed once,
I would have to find source of Editor and clone that function to export
.stl file
and make new Module Export ("filename.stl"), or can You do it for all of
us that
need such thing?
I believe somebody already did that but it was rejected.
So far I find Compiler unpredictable and not explaining errors, which
mostly
happen someplace in the Library.
Yes error reporting is not one of its strong points.
I also do not know where to put ";" at end of
command or module call and where it is forbidden. I decided to put it
everywhere
but sometimes it cause errors?
It marks the end of a statement, so it is critical where it should be. If
you look at
color("green")
translate([20, 0, 0])
rotate([45, 0, 0])
my_cube();
That is all one statement, so it needs one semicolon at the end. If you
put one say after color() you would get two statements. The first would
colour nothing and the translate would start a new statement so you would
get an uncoloured cube that was just rotated and translated.
Perhaps some more time and I would catch rules, I start by doing sipmple
things,
like creating plate and cutting it, and when I would have that Module
ready, I can
build up on that plate something more complicated, cut this and so on.
If you re not alreday familiar with curly brace languages like C then you
need to read and understand the OpenSCAD manual:
https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/The_
OpenSCAD_Language#Chapter_1_--_General
Unfortunately I am half blind and did not do much programming, mostly I
was using
GFA32 Basic, which is not OO Language, but then Open SCAD is not either.
I would need to have access to STL file parameters as well as come
rudimentary
CFD program and then I would be able to make it do all calculations in
paralel and
export results as file that can then be corelated to Stl File parameters
and Cfd
parameters to find out which parameters produce better result.
Than thing can be "Evolved" to best possible solution or parameters. It
is possible
to Cross bred several existing solutions and get something entirely new.
Regards, Marijan Pollak
On Sun, Jan 1, 2017 at 7:16 PM, nop head nop.head@gmail.com wrote:
Firstly statements are not executed as such. They build a tree structure
of geometric primitives and boolean operations. The boolean operations can
be done in any order as long as the operands (which are lower branches in
the tree) have been computed first. So yes things on the right are lower
nodes on the tree and must be computed first. And yes, compound statements
like union() that can span many lines will compute all the things lower in
the tree before the union is computed.
Secondly, OpenSCAD has lexical scope, very much the same as C, so a
variable (which are actually named constants) defined in one module cannot
be accessed in a another. But you can define constants at file level scope,
so if you move imaga=1 outside the Cuts module it will be accessible in
osnova. Or you can declare it as a parameter of osnova and pass it each
time you call it.
On 1 January 2017 at 17:25, Marijan Pollak oberonmp@gmail.com wrote:
Hi, I did not know the difference exist. It may be true that it is
parsed top to bottom, but somehow I
found that what is on the bottom of Module is executed first, then line
up and each line is executed right to left.
There is Example:
module Cuts(){
imaga=1 // Last of all , program is notified that file exist and
need not to be drawn again
//Here cut object has to be exported
;
angleMaleCut(cut = yCut1); // Then male cut is made
angleMaleCut(cut = yCut2);
angleMaleCut(cut = yCut3);
translate ([0,0,0]); // It is aligned to center line
osnova(); // again clone or duplicate
is imported or drawn
angleFemaleCut(cut = yCut1); // then female cuts are made
angleFemaleCut(cut = yCut2);
angleFemaleCut(cut = yCut3);
translate ([-15,0,0]); // It is then moved 15mm on
Xcoordinate
Rotate (0,120,0,); // Second, iti s rotated in y
on horizontal plane
osnova(); // First, .stl file is
Imported or drawn
}
//
module osnova()
{//"scadturbine.stl
echo("Object to cut=",objekt, "ima =", imaga);
if(imaga == 0){drawObject();}
else {import(objekt);}
}
in case there is more then one instruction on one line, they are
executed rightmost first
then left neigbour one by one .
That is consistent with bottom to top execution.
I shall check again by puting some ECHO commands
However, since Imaga =1; is first command If program would work normal
way,
then ECHO would not report Zero in module osnova.
Ups!
.It seems that variables from program were not passed to Module unless
explicitely mentioned in Module
Parameter lists,which means I cannot change value in Module to be
generally available at new state?
Maxbe those multiple instractions were permutable without change of
result?
So how to do it? must put imaga = imaga, in Module parameter list?
Or something else?
Sincerely, Marijan Pollak
On Sun, Jan 1, 2017 at 3:37 PM, nop head nop.head@gmail.com wrote:
Note this is OpenSCAD. Open SCADA is a different, unrelated, project.
I also wonder why is everything in this programming script upside
down and rightside left.
I don't know what you mean. The Syntax and layout are similar to C and
is parsed top to bottom, left to right.
Was this originally made by Chinese?
No, Austrians.
On 1 January 2017 at 08:07, Marijan Pollak oberonmp@gmail.com wrote:
Hello colagues, I noted there is no way to Export .stl file except by
hand,
while Import is working. IMHO, it should be easy to make new Module
ExportStl() by finding same function in Editor. Since I am New to Open
Scada, can some seasoned SCADA programmer do it?
I also wonder why is everything in this programming script upside
down and
rightside left
as compared to other Programming Languages? Was this originally made
by
Chinese?
If I have time I would turn this to normal, as well as make it
faster, this
seems awfully slow
for just few simple Objects added or subtracted one from another.
I really need such parametric 3D drawing program as in 3D Max I cannot
position things precisely by hand. I am inventor whose inventions
would save
the World, so by helping me You would help Yourself also.
What I am trying to do at moment is to find way to cut large objects
symetrically like by Puzzlecut, to be able to 3D print pieces of large
objects on small 3D printer, I.E. 25 x 25 cm
pieces of 100 cm diameter objects. I tried to attach the picture here
but
script hanged up, so this time I would try to do it separately....
Thanks in advance and I wish You all Healthy, Happy anf Prosperous
2017!
--
View this message in context: http://forum.openscad.org/Expo
rt-Stl-File-module-tp19829.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
--
Regards from Croatia, the Homeland of one of greatest inventors from
19th and 20th Centuries, Engineer Nikola Tesla!
OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
--
Regards from Croatia, the Homeland of one of greatest inventors from 19th
and 20th Centuries, Engineer Nikola Tesla!
OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
--
Regards from Croatia, the Homeland of one of greatest inventors from 19th
and 20th Centuries, Engineer Nikola Tesla!
Thank You Very Kindly!
I suppose I can generate whole turbine by generating 1/ 3 of points and
making Extrude,
then rotating object 120 degtees and repeating or just cutting that out
with Puzzlecut and
joining 3 pieces after they are printed on 3D printer..... Can I draw on
surface of cylinder
and then Extrude2D to get one joined object, or this has to be made
separate object first
So, I must experiment.... Is there a way to build 3D object that way?
Same, there would be many points anyhow, so many lines in .txt file.
How do I signal to program that next line is continuation of points?
I also suppose that last point should be first?
or I can draw using primitives like line or circle? I would like to use
Rotate Extrude and also make
Welds. I suppose once I extrude this form to 3D I have to save object
created, after which I can
Join or subtract some primitives like from any other Objects imported?
On Sun, Jan 1, 2017 at 10:50 PM, Ronaldo Persiano rcmpersiano@gmail.com
wrote:
Pollak,
Except in cases of heavy and complex models, you should not be concerned
about avoiding to rebuild a "clone" in OpenSCAD. The system keeps computed
models and values in cache so its reuse doesn't require reevaluations.
About your turbine design code: in principle, you have two alternatives;
one is to compute the profiles through an OpenSCAD code generating points
and passing them to a polygon() or polyhedron(); or change the code of your
external profile generator in order to produce its output as a text file of
the form:
points = [ [...], [...], ...];
This text file is then made part of your OpenSCAD code with:
use <profile_points.txt>
at its beginning.
Ronaldo
OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
--
Regards from Croatia, the Homeland of one of greatest inventors from 19th
and 20th Centuries, Engineer Nikola Tesla!
--
View this message in context: http://forum.openscad.org/Export-Stl-File-module-tp19829p19844.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
Marijan Pollak wrote
Ok, Module can see Global Variable but it cannot change itts value.
However if there is local variable with same name, i.e kerf in the
Puzzlecut then I must write kerf=kerf in module parameter list,
and I find some modules have kerf=0 as parameter which is
confusing me, as it seems not used in that module MaleCut,
but someplace else, outside of Puzzlecut.Lib
PuzzleCut uses a valid scope rule that I would not recommend. Look at this
code:
global = 10;
printGlobal();
printGlobal(global=0);
module printGlobal() {
print(global);
}
module print(a){
echo(a);
}
The console output will be:
ECHO: 10
ECHO: 0
The module printGlobal() has no parameters and just print() the variable
global; but when the module is called with global=0 as it was a parameter, a
new "local" variable global is instantiated in the new scope. So,
print(global) will echo this new value.
In PuzzleCut, kerf is global but is sometimes overridden in some function or
module calls.
It is a valid construct in OpenSCAD but it is safer and clearer to define as
parameter instead.
--
View this message in context: http://forum.openscad.org/Export-Stl-File-module-tp19829p19845.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
a) You will find a lot of information about how to program with OpenSCAD in
the net. A good starting point is
https://www.thingiverse.com/jumpstart/openscad
b) Doing a web search like "programming openscad" will further present you a
large list of programming guides and courses that go deeper into different
aspects of OpenSCAD.
c) In Thingiverse finally you will find tens of thousands of code examples
for designs done with OpenSCAD. So, if you are interested how to express
some turbine design, search there for "tubine" and have a look at designs
which are similar and offer .scad files for download.
--
View this message in context: http://forum.openscad.org/Export-Stl-File-module-tp19829p19846.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
Marijan Pollak wrote
I suppose I can generate whole turbine by generating 1/ 3 of points and
making Extrude,
then rotating object 120 degtees and repeating or just cutting that out
with Puzzlecut and
joining 3 pieces after they are printed on 3D printer..... Can I draw on
surface of cylinder
and then Extrude2D to get one joined object, or this has to be made
separate object first?
So, I must experiment.... Is there a way to build 3D object that way?
I am not sure what you meant by that.
Same, there would be many points anyhow, so many lines in .txt file.
How do I signal to program that next line is continuation of points?
I also suppose that last point should be first?
Any used or included text file must be written following the OpenSCAD
language.
Hence all end-of-line characters are ignored.
or I can draw using primitives like line or circle?
There is no line or circle primitives in OpenSCAD, only volumetric
primitives.
I would like to use
Rotate Extrude and also make
Welds. I suppose once I extrude this form to 3D I have to save object
created, after which I can
Join or subtract some primitives like from any other Objects imported?
As said before, you may define a solid with a module and use it many times
as needed. You don't have to "save it". Refer to the nophead's code example.
--
View this message in context: http://forum.openscad.org/Export-Stl-File-module-tp19829p19848.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
There is no line or circle primitives in OpenSCAD
There is no line but there certainly is circle() and square() as well as
polygon() for making 2D shapes. They can be combined with the same boolean
ops as 3D and they can be converted to 3D with linear_extrude() and
rotate_extrude().
On 2 January 2017 at 14:46, Ronaldo rcmpersiano@gmail.com wrote:
Marijan Pollak wrote
I suppose I can generate whole turbine by generating 1/ 3 of points and
making Extrude,
then rotating object 120 degtees and repeating or just cutting that out
with Puzzlecut and
joining 3 pieces after they are printed on 3D printer..... Can I draw on
surface of cylinder
and then Extrude2D to get one joined object, or this has to be made
separate object first?
So, I must experiment.... Is there a way to build 3D object that way?
I am not sure what you meant by that.
Same, there would be many points anyhow, so many lines in .txt file.
How do I signal to program that next line is continuation of points?
I also suppose that last point should be first?
Any used or included text file must be written following the OpenSCAD
language.
Hence all end-of-line characters are ignored.
or I can draw using primitives like line or circle?
There is no line or circle primitives in OpenSCAD, only volumetric
primitives.
I would like to use
Rotate Extrude and also make
Welds. I suppose once I extrude this form to 3D I have to save object
created, after which I can
Join or subtract some primitives like from any other Objects imported?
As said before, you may define a solid with a module and use it many times
as needed. You don't have to "save it". Refer to the nophead's code
example.
--
View this message in context: http://forum.openscad.org/
Export-Stl-File-module-tp19829p19848.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
You are right, sorry. I meant circumference.
2017-01-02 13:01 GMT-02:00 nop head nop.head@gmail.com:
There is no line or circle primitives in OpenSCAD
There is no line but there certainly is circle() and square() as well as
polygon() for making 2D shapes. They can be combined with the same boolean
ops as 3D and they can be converted to 3D with linear_extrude() and
rotate_extrude().
On 2 January 2017 at 14:46, Ronaldo rcmpersiano@gmail.com wrote:
Marijan Pollak wrote
I suppose I can generate whole turbine by generating 1/ 3 of points and
making Extrude,
then rotating object 120 degtees and repeating or just cutting that out
with Puzzlecut and
joining 3 pieces after they are printed on 3D printer..... Can I draw on
surface of cylinder
and then Extrude2D to get one joined object, or this has to be made
separate object first?
So, I must experiment.... Is there a way to build 3D object that way?
I am not sure what you meant by that.
Same, there would be many points anyhow, so many lines in .txt file.
How do I signal to program that next line is continuation of points?
I also suppose that last point should be first?
Any used or included text file must be written following the OpenSCAD
language.
Hence all end-of-line characters are ignored.
or I can draw using primitives like line or circle?
There is no line or circle primitives in OpenSCAD, only volumetric
primitives.
I would like to use
Rotate Extrude and also make
Welds. I suppose once I extrude this form to 3D I have to save object
created, after which I can
Join or subtract some primitives like from any other Objects imported?
As said before, you may define a solid with a module and use it many times
as needed. You don't have to "save it". Refer to the nophead's code
example.
--
View this message in context: http://forum.openscad.org/Expo
rt-Stl-File-module-tp19829p19848.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
Dear Coleague, So, my logic was correct in case of program execution,
so IMHO it would be more practicall that programmer write same way as
program execute. This way fewer mistakes would be made.
Also Imaga is Variable, not constant. it means "it is there" or "Object
exist"
and signal that there is file to be Imported and all previous work on
generating
Object can be skipped. Time saved is enormous, specially with very complex
objects.
Since program execute oposite then it is written, I concluded I would have
to
write code converter to be able to follow standard logic of programming.
It would be easier if someone change this so people drawing the Objects
would not have to adjust to way program generates Objects.
Programming is invented so they can help Programmers to write correct code
NOT that programmers should help Computer to do it upside down.
I do not know how such bug was not noted and made right.
that is Microsoft style of Programming and logic. "It is not a Bug, it is a
FEATURE"?
On Sun, Jan 1, 2017 at 7:18 PM, nophead [via OpenSCAD] <
ml-node+s1091067n19834h60@n5.nabble.com> wrote:
Firstly statements are not executed as such. They build a tree structure
of geometric primitives and boolean operations. The boolean operations can
be done in any order as long as the operands (which are lower branches in
the tree) have been computed first. So yes things on the right are lower
nodes on the tree and must be computed first. And yes, compound statements
like union() that can span many lines will compute all the things lower in
the tree before the union is computed.
Secondly, OpenSCAD has lexical scope, very much the same as C, so a
variable (which are actually named constants) defined in one module cannot
be accessed in a another. But you can define constants at file level scope,
so if you move imaga=1 outside the Cuts module it will be accessible in
osnova. Or you can declare it as a parameter of osnova and pass it each
time you call it.
On 1 January 2017 at 17:25, Marijan Pollak <[hidden email]
http:///user/SendEmail.jtp?type=node&node=19834&i=0> wrote:
Hi, I did not know the difference exist. It may be true that it is parsed
top to bottom, but somehow I
found that what is on the bottom of Module is executed first, then line
up and each line is executed right to left.
There is Example:
module Cuts(){
imaga=1 // Last of all , program is notified that file exist and
need not to be drawn again
//Here cut object has to be exported
;
angleMaleCut(cut = yCut1); // Then male cut is made
angleMaleCut(cut = yCut2);
angleMaleCut(cut = yCut3);
translate ([0,0,0]); // It is aligned to center line
osnova(); // again clone or duplicate
is imported or drawn
angleFemaleCut(cut = yCut1); // then female cuts are made
angleFemaleCut(cut = yCut2);
angleFemaleCut(cut = yCut3);
translate ([-15,0,0]); // It is then moved 15mm on
Xcoordinate
Rotate (0,120,0,); // Second, iti s rotated in y on
horizontal plane
osnova(); // First, .stl file is
Imported or drawn
}
//
module osnova()
{//"scadturbine.stl
echo("Object to cut=",objekt, "ima =", imaga);
if(imaga == 0){drawObject();}
else {import(objekt);}
}
in case there is more then one instruction on one line, they are executed
rightmost first
then left neigbour one by one .
That is consistent with bottom to top execution.
I shall check again by puting some ECHO commands
However, since Imaga =1; is first command If program would work normal
way,
then ECHO would not report Zero in module osnova.
Ups!
.It seems that variables from program were not passed to Module unless
explicitely mentioned in Module
Parameter lists,which means I cannot change value in Module to be
generally available at new state?
Maxbe those multiple instractions were permutable without change of
result?
So how to do it? must put imaga = imaga, in Module parameter list?
Or something else?
Sincerely, Marijan Pollak
On Sun, Jan 1, 2017 at 3:37 PM, nop head <[hidden email]
http:///user/SendEmail.jtp?type=node&node=19834&i=1> wrote:
Note this is OpenSCAD. Open SCADA is a different, unrelated, project.
I also wonder why is everything in this programming script upside down
and rightside left.
I don't know what you mean. The Syntax and layout are similar to C and
is parsed top to bottom, left to right.
Was this originally made by Chinese?
No, Austrians.
On 1 January 2017 at 08:07, Marijan Pollak <[hidden email]
http:///user/SendEmail.jtp?type=node&node=19834&i=2> wrote:
Hello colagues, I noted there is no way to Export .stl file except by
hand,
while Import is working. IMHO, it should be easy to make new Module
ExportStl() by finding same function in Editor. Since I am New to Open
Scada, can some seasoned SCADA programmer do it?
I also wonder why is everything in this programming script upside down
and
rightside left
as compared to other Programming Languages? Was this originally made by
Chinese?
If I have time I would turn this to normal, as well as make it faster,
this
seems awfully slow
for just few simple Objects added or subtracted one from another.
I really need such parametric 3D drawing program as in 3D Max I cannot
position things precisely by hand. I am inventor whose inventions would
save
the World, so by helping me You would help Yourself also.
What I am trying to do at moment is to find way to cut large objects
symetrically like by Puzzlecut, to be able to 3D print pieces of large
objects on small 3D printer, I.E. 25 x 25 cm
pieces of 100 cm diameter objects. I tried to attach the picture here
but
script hanged up, so this time I would try to do it separately....
Thanks in advance and I wish You all Healthy, Happy anf Prosperous 2017!
--
View this message in context: http://forum.openscad.org/Expo
rt-Stl-File-module-tp19829.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
OpenSCAD mailing list
[hidden email] http:///user/SendEmail.jtp?type=node&node=19834&i=3
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
OpenSCAD mailing list
[hidden email] http:///user/SendEmail.jtp?type=node&node=19834&i=4
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
--
Regards from Croatia, the Homeland of one of greatest inventors from 19th
and 20th Centuries, Engineer Nikola Tesla!
OpenSCAD mailing list
[hidden email] http:///user/SendEmail.jtp?type=node&node=19834&i=5
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
OpenSCAD mailing list
[hidden email] http:///user/SendEmail.jtp?type=node&node=19834&i=6
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/Export-Stl-File-module-tp19829p19834.html
To unsubscribe from Export Stl. File module, click here
http://forum.openscad.org/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=19829&code=b2Jlcm9ubXBAZ21haWwuY29tfDE5ODI5fC00Mzg5MzYyNzk=
.
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
--
Regards from Croatia, the Homeland of one of greatest inventors from 19th
and 20th Centuries, Engineer Nikola Tesla!
--
View this message in context: http://forum.openscad.org/Export-Stl-File-module-tp19829p19851.html
Sent from the OpenSCAD mailing list archive at Nabble.com.