Export Stl. File module

classic Classic list List threaded Threaded
65 messages Options
1234
Reply | Threaded
Open this post in threaded view
|

Export Stl. File module

Marijan Pollak
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!
tp3
Reply | Threaded
Open this post in threaded view
|

Re: Export Stl. File module

tp3
On 01/01/2017 09:07 AM, Marijan Pollak 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?
>
The following thread has some discussion about this topic
http://forum.openscad.org/export-function-td15428.html

> 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.
>
This would be very welcome, at this point it would mean
either making CGAL (http://www.cgal.org/) faster for CSG
operations or find/implement a different library to do
CSG.

ciao,
  Torsten.


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
-- Torsten
Reply | Threaded
Open this post in threaded view
|

Re: Export Stl. File module

nophead
In reply to this post by Marijan Pollak
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]> 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/Export-Stl-File-module-tp19829.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
Reply | Threaded
Open this post in threaded view
|

Re: Export Stl. File module

Marijan Pollak
In reply to this post by tp3
Hello Thorsten, unfortunately those people write about Security risk which I do not understand.
1st. Import and export are possible only from same folder where SCADA programs are.
2nd. If I cannot read in unknown files, how can program know what to delete/rewrite?
3rd. Is simple confirmation from user not possible in case of new file writting?
4th. User may have to delete some files by hand if not required.
I suceeded to open file in Alphanumeric field, therefore it should be possible to compose file name
by program, export it and then import it again and when cut export to different file.
​As You can see I need to cut my turbine in at least 6 ways, however with just 4 parts I
can repeat this group 3 times and compose large turbine of 50 cm diameter.
I would however like  to cut center as circle, as large as can be printed on 18 x 18cm x 25cm
workspace of 3D printer. However all pieces have to be securely hooked one to another.
Likewise, it would be usefull if I can construct the Knife  and then reuse it as many times as required.
Present system of cutting requires 2 separate cuts on two clones of same object, why it cannot be
done in 1 cut and then separate pieces into two objects, since one side of cut is always removed, therefore computer is able to detect  which is Male and which is Female side.
Alternative would be to attach each side of Cut  to part it belong to and remove just "Kerf" distance 
which then cannot be negative, of course.
It would be great help to be able to  determine cut lines and then situate hooks at the middle as two
pairs of T  profiled connectors  or one pair of joined cylinders then such twinned cylinders can be used to extract difference that was cut out. with exact fit it would be as if it was made from one piece, right?
Same way central circle can be cut out and Difference taken out of clone. However at least 3 holes must be made on separation circle, where it would be fixed by screws.
Any advice would be most welcome. This 2D drawing was made by program, can it be repeated in
SCADA and then extruded? I would neeed many sizes  of turbines with same wall thickness of Air
Chambers. but it would alsi be usefull that botom would not be flat. I can therefore first form bottom
by following paralel linesand pulling half circle between, and then extrude same lines up.
But after this I have to cut it all up.........
I promise You huge donation when my turbines start to sell, or one WPS of 2.5 KW that You can use or sell to someone for few 1000€'s.
Is it a deal?
Sincerely, Marijan Pollak  

On Sun, Jan 1, 2017 at 2:10 PM, tp3 [via OpenSCAD] <[hidden email]> wrote:
On 01/01/2017 09:07 AM, Marijan Pollak 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?
>
The following thread has some discussion about this topic
http://forum.openscad.org/export-function-td15428.html

> 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.
>
This would be very welcome, at this point it would mean
either making CGAL (http://www.cgal.org/) faster for CSG
operations or find/implement a different library to do
CSG.

ciao,
  Torsten.


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
-- Torsten



If you reply to this email, your message will be added to the discussion below:
http://forum.openscad.org/Export-Stl-File-module-tp19829p19830.html
To unsubscribe from Export Stl. File module, click here.
NAML



--
Regards from Croatia, the Homeland of one of greatest inventors from 19th and 20th Centuries, Engineer Nikola Tesla!
Reply | Threaded
Open this post in threaded view
|

Re: Export Stl. File module

Marijan Pollak
In reply to this post by nophead
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]> 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]> 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/Export-Stl-File-module-tp19829.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




--
Regards from Croatia, the Homeland of one of greatest inventors from 19th and 20th Centuries, Engineer Nikola Tesla!

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Export Stl. File module

nophead
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]> 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]> 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]> 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/Export-Stl-File-module-tp19829.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




--
Regards from Croatia, the Homeland of one of greatest inventors from 19th and 20th Centuries, Engineer Nikola Tesla!

_______________________________________________
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
tp3
Reply | Threaded
Open this post in threaded view
|

Re: Export Stl. File module

tp3
In reply to this post by Marijan Pollak
On 01/01/2017 04:58 PM, Marijan Pollak wrote:
> Hello Thorsten, unfortunately those people write about Security
> risk which I do not understand.
>
I don't see the security part as the main topic for the
export feature. Direct export does not fit into the whole
model of how OpenSCAD works, it generates a data structure
that describes a 2D or 3D model, it's not a program having
a runtime.

The basic idea to handle multi part models is to add this
information to the data structure and have the export
function pick that up to export all parts in one step.
Details are still to be defined.

Until this is done, there's a reasonable workaround
described in the FAQ
https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/FAQ#Export

ciao,
  Torsten.


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
-- Torsten
Reply | Threaded
Open this post in threaded view
|

Re: Export Stl. File module

Ronaldo
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
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Export Stl. File module

Marijan Pollak
In reply to this post by nophead
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.
Are Functions different?
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.
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?
So far  I find Compiler unpredictable and not explaining errors, which mostly
happen someplace in the Library. 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?
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.
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 <[hidden email]> 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]> 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]> 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]> 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/Export-Stl-File-module-tp19829.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




--
Regards from Croatia, the Homeland of one of greatest inventors from 19th and 20th Centuries, Engineer Nikola Tesla!

_______________________________________________
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




--
Regards from Croatia, the Homeland of one of greatest inventors from 19th and 20th Centuries, Engineer Nikola Tesla!

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Export Stl. File module

Marijan Pollak
In reply to this post by tp3
I have never seen anything like this, therefore I do not understand.
Is it that You are adding this to Editor as Plugin of sort so .stl Button
would do it when pressed, instead of writting out just one file?
That we call "going hand to pocket around backside"......
So it stay this way untill I change it? Maybe I can do it, just I did not
find way to cut things precisely to some 12 parts, and if they would
stay together in one file then it is not problem to do it even just using
the button, problem is, once I cut thing in two, I can export part that
need no further cutting and remove it, and cut remainder again.
I do not know if SCAD treat result of cutting as one or two objects,
and how can I select one piece I want to export. If I would be able to
do it programatically, then there is no need to do it complicated way.
Where is that Editor source code? I think making Module should not
take more than half an hour, I just have to ape what that button click
do, after its module or function  receive file name to Export.
Or someone sit on it? That assuming It is same as any other Module
in Open Scad.....  


On Sun, Jan 1, 2017 at 9:15 PM, Torsten Paul <[hidden email]> wrote:
On 01/01/2017 04:58 PM, Marijan Pollak wrote:
> Hello Thorsten, unfortunately those people write about Security
> risk which I do not understand.
>
I don't see the security part as the main topic for the
export feature. Direct export does not fit into the whole
model of how OpenSCAD works, it generates a data structure
that describes a 2D or 3D model, it's not a program having
a runtime.

The basic idea to handle multi part models is to add this
information to the data structure and have the export
function pick that up to export all parts in one step.
Details are still to be defined.

Until this is done, there's a reasonable workaround
described in the FAQ
https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/FAQ#Export

ciao,
  Torsten.


_______________________________________________
OpenSCAD mailing list
[hidden email]
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://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Export Stl. File module

nophead
In reply to this post by Marijan Pollak

On 2 January 2017 at 10:33, Marijan Pollak <[hidden email]> 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 <[hidden email]> 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]> 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]> 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]> 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/Export-Stl-File-module-tp19829.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




--
Regards from Croatia, the Homeland of one of greatest inventors from 19th and 20th Centuries, Engineer Nikola Tesla!

_______________________________________________
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




--
Regards from Croatia, the Homeland of one of greatest inventors from 19th and 20th Centuries, Engineer Nikola Tesla!

_______________________________________________
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
Reply | Threaded
Open this post in threaded view
|

Re: Export Stl. File module

Marijan Pollak
In reply to this post by Ronaldo
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 <[hidden email]> 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
[hidden email]
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://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Export Stl. File module

Marijan Pollak
In reply to this post by nophead
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 <[hidden email]> wrote:

On 2 January 2017 at 10:33, Marijan Pollak <[hidden email]> 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 <[hidden email]> 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]> 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]> 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]> 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/Export-Stl-File-module-tp19829.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




--
Regards from Croatia, the Homeland of one of greatest inventors from 19th and 20th Centuries, Engineer Nikola Tesla!

_______________________________________________
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




--
Regards from Croatia, the Homeland of one of greatest inventors from 19th and 20th Centuries, Engineer Nikola Tesla!

_______________________________________________
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




--
Regards from Croatia, the Homeland of one of greatest inventors from 19th and 20th Centuries, Engineer Nikola Tesla!

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Export Stl. File module

Marijan Pollak
In reply to this post by Ronaldo
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 <[hidden email]> 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
[hidden email]
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!
Reply | Threaded
Open this post in threaded view
|

Re: Export Stl. File module

Ronaldo
In reply to this post by Marijan Pollak
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.
Reply | Threaded
Open this post in threaded view
|

Re: Export Stl. File module

Parkinbot
In reply to this post by Marijan Pollak
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.

Reply | Threaded
Open this post in threaded view
|

Re: Export Stl. File module

Ronaldo
In reply to this post by Marijan Pollak
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.
Reply | Threaded
Open this post in threaded view
|

Re: Export Stl. File module

nophead
>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 <[hidden email]> 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
[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
Reply | Threaded
Open this post in threaded view
|

Re: Export Stl. File module

Ronaldo
You are right, sorry. I meant circumference.

2017-01-02 13:01 GMT-02:00 nop head <[hidden email]>:
>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 <[hidden email]> 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
[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



_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Export Stl. File module

Marijan Pollak
In reply to this post by nophead
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] <[hidden email]> 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]> 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]> 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]> 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/Export-Stl-File-module-tp19829.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




--
Regards from Croatia, the Homeland of one of greatest inventors from 19th and 20th Centuries, Engineer Nikola Tesla!

_______________________________________________
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/Export-Stl-File-module-tp19829p19834.html
To unsubscribe from Export Stl. File module, click here.
NAML



--
Regards from Croatia, the Homeland of one of greatest inventors from 19th and 20th Centuries, Engineer Nikola Tesla!
1234