M
MichaelAtOz
Sat, Dec 17, 2016 10:08 AM
I repeat:
Your post is still flagged as "This post has NOT been accepted by the
mailing list yet", so nobody gets it unless they look.
You need to subscribe to the mailing list
http://forum.openscad.org/mailing_list/MailingListOptions.jtp?forum=1 ,
and respond to the registration email.
I get it as a reject as the admin. Please subscribe.
Copied below for the regular polyhedron hunters...
LucRol wrote
Hello,
Sorry, I ommit the raw tag !
This code don't update the p vector, so the polyhedron fails !?
// Test_Prisme.scad : Test du module Prisme triangulaire
// Luc ROLLAND - 15/12/2016
// Tested with OpenSCAD 2015.03-2 and 2016.10.04
prisme(5,15,8,2);
// This synthax fails
module prisme(x, y, z, sens){
// Creating p in the module scope :
p = [ [0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0] ];
if(sens == 1) {
p = [ [0,0,0],[x,0,0],[x,y,0],[0,y,0],[0,y,z],[x,y,z] ]; }
else if(sens == -1) {
p = [ [0,0,0],[x,0,0],[x,y,0],[0,y,0],[0,y,-z],[x,y,-z] ]; }
else if(sens == 2) {
cube(2, center=true); // TEST pass here
p = [ [0,0,0],[x,0,0],[x,y,0],[0,y,0],[0,0,z],[x,0,z] ]; }
else if(sens == -2) {
p = [ [0,0,0],[x,0,0],[x,y,0],[0,y,0], [0,0,-z],[x,0,-z] ]; }
else {
cube(1, center=true); // IF sens WRONG
}
//p = [ [0,0,0],[x,0,0],[x,y,0],[0,y,0],[0,0,z],[x,0,z] ]; // WORKS !
faces=[ [0,1,2,3],[3,2,5,4],[4,5,1,0],[0,3,4],[5,2,1] ];
polyhedron(points=p, faces, convexity=2); // Saying p unknown !?
}
//
/* But this synthax works !
module prisme(x, y, z, sens){
f = [ [0,1,2,3],[3,2,5,4],[4,5,1,0],[0,3,4],[5,2,1] ];
c = 2 ;
if(sens == 1)
polyhedron(
points = [ [0,0,0],[x,0,0],[x,y,0],[0,y,0],[0,y,z],[x,y,z] ],
faces = f,
convexity = c );
else if(sens == -1)
polyhedron(
points = [ [0,0,0],[x,0,0],[x,y,0],[0,y,0],[0,y,-z],[x,y,-z] ],
faces = f,
convexity = c );
else if(sens == 2)
polyhedron(
points = [ [0,0,0],[x,0,0],[x,y,0],[0,y,0],[0,0,z],[x,0,z] ],
faces = f,
convexity = c );
else if(sens == -2)
polyhedron(
points = [ [0,0,0],[x,0,0],[x,y,0],[0,y,0], [0,0,-z],[x,0,-z] ],
faces = f,
convexity = c );
}
*/
I don't see my error, perhaps a BUG ?
Any idea ?
Best regards
Luc
Admin - PM me if you need anything, or if I've done something stupid...
Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. Obviously inclusion of works of previous authors is not included in the above.
The TPP is no simple “trade agreement.” Fight it! http://www.ourfairdeal.org/ time is running out!
View this message in context: http://forum.openscad.org/Vector-affectation-seem-not-working-in-test-tp19584p19594.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
I repeat:
Your post is still flagged as "This post has NOT been accepted by the
mailing list yet", so nobody gets it unless they look.
You need to subscribe to the mailing list
<http://forum.openscad.org/mailing_list/MailingListOptions.jtp?forum=1> ,
and respond to the registration email.
I get it as a reject as the admin. Please subscribe.
Copied below for the regular polyhedron hunters...
LucRol wrote
> Hello,
>
> Sorry, I ommit the raw tag !
>
> This code don't update the p vector, so the polyhedron fails !?
>
> // Test_Prisme.scad : Test du module Prisme triangulaire
> // Luc ROLLAND - 15/12/2016
> // Tested with OpenSCAD 2015.03-2 and 2016.10.04
>
> prisme(5,15,8,2);
>
> // This synthax fails
> module prisme(x, y, z, sens){
> // Creating p in the module scope :
> p = [ [0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0] ];
> if(sens == 1) {
> p = [ [0,0,0],[x,0,0],[x,y,0],[0,y,0],[0,y,z],[x,y,z] ]; }
> else if(sens == -1) {
> p = [ [0,0,0],[x,0,0],[x,y,0],[0,y,0],[0,y,-z],[x,y,-z] ]; }
> else if(sens == 2) {
> cube(2, center=true); // TEST pass here
> p = [ [0,0,0],[x,0,0],[x,y,0],[0,y,0],[0,0,z],[x,0,z] ]; }
> else if(sens == -2) {
> p = [ [0,0,0],[x,0,0],[x,y,0],[0,y,0], [0,0,-z],[x,0,-z] ]; }
> else {
> cube(1, center=true); // IF sens WRONG
> }
> //p = [ [0,0,0],[x,0,0],[x,y,0],[0,y,0],[0,0,z],[x,0,z] ]; // WORKS !
> faces=[ [0,1,2,3],[3,2,5,4],[4,5,1,0],[0,3,4],[5,2,1] ];
> polyhedron(points=p, faces, convexity=2); // Saying p unknown !?
> }
> //
> /* But this synthax works !
> module prisme(x, y, z, sens){
> f = [ [0,1,2,3],[3,2,5,4],[4,5,1,0],[0,3,4],[5,2,1] ];
> c = 2 ;
> if(sens == 1)
> polyhedron(
> points = [ [0,0,0],[x,0,0],[x,y,0],[0,y,0],[0,y,z],[x,y,z] ],
> faces = f,
> convexity = c );
> else if(sens == -1)
> polyhedron(
> points = [ [0,0,0],[x,0,0],[x,y,0],[0,y,0],[0,y,-z],[x,y,-z] ],
> faces = f,
> convexity = c );
> else if(sens == 2)
> polyhedron(
> points = [ [0,0,0],[x,0,0],[x,y,0],[0,y,0],[0,0,z],[x,0,z] ],
> faces = f,
> convexity = c );
> else if(sens == -2)
> polyhedron(
> points = [ [0,0,0],[x,0,0],[x,y,0],[0,y,0], [0,0,-z],[x,0,-z] ],
> faces = f,
> convexity = c );
> }
> */
>
> I don't see my error, perhaps a BUG ?
> Any idea ?
>
> Best regards
> Luc
-----
Admin - PM me if you need anything, or if I've done something stupid...
Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. Obviously inclusion of works of previous authors is not included in the above.
The TPP is no simple “trade agreement.” Fight it! http://www.ourfairdeal.org/ time is running out!
--
View this message in context: http://forum.openscad.org/Vector-affectation-seem-not-working-in-test-tp19584p19594.html
Sent from the OpenSCAD mailing list archive at Nabble.com.
NH
nop head
Sat, Dec 17, 2016 10:57 AM
Each p inside braces is a new one in a scope that lasts to the closing
brace. That is why it has no effect. But also in OpenSCAD a variable can
only have one value and that is the last value assigned.
This is the syntax you need:
module prisme(x, y, z, sens){
p = sens == 1 ? [ [0,0,0],[x,0,0],[x,y,0],[0,y,0],[0,y,z],[x,y,z] ] :
sens == -1 ? [ [0,0,0],[x,0,0],[x,y,0],[0,y,0],[0,y,-z],[x,y,-z] ] :
sens == 2 ? [ [ [0,0,0],[x,0,0],[x,y,0],[0,y,0],[0,0,z],[x,0,z] ] :
sens == -2 ? [ [0,0,0],[x,0,0],[x,y,0],[0,y,0], [0,0,-z],[x,0,-z] ] :
[ [0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0] ];
faces=[ [0,1,2,3],[3,2,5,4],[4,5,1,0],[0,3,4],[5,2,1] ];
polyhedron(points=p, faces, convexity=2);
}
On 17 December 2016 at 10:08, MichaelAtOz oz.at.michael@gmail.com wrote:
I repeat:
Your post is still flagged as "This post has NOT been accepted by the
mailing list yet", so nobody gets it unless they look.
You need to subscribe to the mailing list
http://forum.openscad.org/mailing_list/MailingListOptions.jtp?forum=1 ,
and respond to the registration email.
I get it as a reject as the admin. Please subscribe.
Copied below for the regular polyhedron hunters...
LucRol wrote
Hello,
Sorry, I ommit the raw tag !
This code don't update the p vector, so the polyhedron fails !?
// Test_Prisme.scad : Test du module Prisme triangulaire
// Luc ROLLAND - 15/12/2016
// Tested with OpenSCAD 2015.03-2 and 2016.10.04
prisme(5,15,8,2);
// This synthax fails
module prisme(x, y, z, sens){
// Creating p in the module scope :
p = [ [0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0] ];
if(sens == 1) {
p = [ [0,0,0],[x,0,0],[x,y,0],[0,y,0],[0,y,z],[x,y,z] ]; }
else if(sens == -1) {
p = [ [0,0,0],[x,0,0],[x,y,0],[0,y,0],[0,y,-z],[x,y,-z] ]; }
else if(sens == 2) {
cube(2, center=true); // TEST pass here
p = [ [0,0,0],[x,0,0],[x,y,0],[0,y,0],[0,0,z],[x,0,z] ]; }
else if(sens == -2) {
p = [ [0,0,0],[x,0,0],[x,y,0],[0,y,0], [0,0,-z],[x,0,-z] ]; }
else {
cube(1, center=true); // IF sens WRONG
}
//p = [ [0,0,0],[x,0,0],[x,y,0],[0,y,0],[0,0,z],[x,0,z] ]; // WORKS !
faces=[ [0,1,2,3],[3,2,5,4],[4,5,1,0],[0,3,4],[5,2,1] ];
polyhedron(points=p, faces, convexity=2); // Saying p unknown !?
}
//
/* But this synthax works !
module prisme(x, y, z, sens){
f = [ [0,1,2,3],[3,2,5,4],[4,5,1,0],[0,3,4],[5,2,1] ];
c = 2 ;
if(sens == 1)
polyhedron(
points = [ [0,0,0],[x,0,0],[x,y,0],[0,y,0],[0,y,z],[x,y,z] ],
faces = f,
convexity = c );
else if(sens == -1)
polyhedron(
points = [ [0,0,0],[x,0,0],[x,y,0],[0,y,0],[0,y,-z],[x,y,-z] ],
faces = f,
convexity = c );
else if(sens == 2)
polyhedron(
points = [ [0,0,0],[x,0,0],[x,y,0],[0,y,0],[0,0,z],[x,0,z] ],
faces = f,
convexity = c );
else if(sens == -2)
polyhedron(
points = [ [0,0,0],[x,0,0],[x,y,0],[0,y,0], [0,0,-z],[x,0,-z] ],
faces = f,
convexity = c );
}
*/
I don't see my error, perhaps a BUG ?
Any idea ?
Best regards
Luc
Admin - PM me if you need anything, or if I've done something stupid...
Unless specifically shown otherwise above, my contribution is in the
Public Domain; to the extent possible under law, I have waived all
copyright and related or neighbouring rights to this work. Obviously
inclusion of works of previous authors is not included in the above.
The TPP is no simple “trade agreement.” Fight it!
http://www.ourfairdeal.org/ time is running out!
View this message in context: http://forum.openscad.org/
Vector-affectation-seem-not-working-in-test-tp19584p19594.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
Each p inside braces is a new one in a scope that lasts to the closing
brace. That is why it has no effect. But also in OpenSCAD a variable can
only have one value and that is the last value assigned.
This is the syntax you need:
module prisme(x, y, z, sens){
p = sens == 1 ? [ [0,0,0],[x,0,0],[x,y,0],[0,y,0],[0,y,z],[x,y,z] ] :
sens == -1 ? [ [0,0,0],[x,0,0],[x,y,0],[0,y,0],[0,y,-z],[x,y,-z] ] :
sens == 2 ? [ [ [0,0,0],[x,0,0],[x,y,0],[0,y,0],[0,0,z],[x,0,z] ] :
sens == -2 ? [ [0,0,0],[x,0,0],[x,y,0],[0,y,0], [0,0,-z],[x,0,-z] ] :
[ [0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0] ];
faces=[ [0,1,2,3],[3,2,5,4],[4,5,1,0],[0,3,4],[5,2,1] ];
polyhedron(points=p, faces, convexity=2);
}
On 17 December 2016 at 10:08, MichaelAtOz <oz.at.michael@gmail.com> wrote:
> I repeat:
>
> Your post is still flagged as "This post has NOT been accepted by the
> mailing list yet", so nobody gets it unless they look.
> You need to subscribe to the mailing list
> <http://forum.openscad.org/mailing_list/MailingListOptions.jtp?forum=1> ,
> and respond to the registration email.
>
> I get it as a reject as the admin. Please subscribe.
>
> Copied below for the regular polyhedron hunters...
>
>
> LucRol wrote
> > Hello,
> >
> > Sorry, I ommit the raw tag !
> >
> > This code don't update the p vector, so the polyhedron fails !?
> >
> > // Test_Prisme.scad : Test du module Prisme triangulaire
> > // Luc ROLLAND - 15/12/2016
> > // Tested with OpenSCAD 2015.03-2 and 2016.10.04
> >
> > prisme(5,15,8,2);
> >
> > // This synthax fails
> > module prisme(x, y, z, sens){
> > // Creating p in the module scope :
> > p = [ [0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0] ];
> > if(sens == 1) {
> > p = [ [0,0,0],[x,0,0],[x,y,0],[0,y,0],[0,y,z],[x,y,z] ]; }
> > else if(sens == -1) {
> > p = [ [0,0,0],[x,0,0],[x,y,0],[0,y,0],[0,y,-z],[x,y,-z] ]; }
> > else if(sens == 2) {
> > cube(2, center=true); // TEST pass here
> > p = [ [0,0,0],[x,0,0],[x,y,0],[0,y,0],[0,0,z],[x,0,z] ]; }
> > else if(sens == -2) {
> > p = [ [0,0,0],[x,0,0],[x,y,0],[0,y,0], [0,0,-z],[x,0,-z] ]; }
> > else {
> > cube(1, center=true); // IF sens WRONG
> > }
> > //p = [ [0,0,0],[x,0,0],[x,y,0],[0,y,0],[0,0,z],[x,0,z] ]; // WORKS !
> > faces=[ [0,1,2,3],[3,2,5,4],[4,5,1,0],[0,3,4],[5,2,1] ];
> > polyhedron(points=p, faces, convexity=2); // Saying p unknown !?
> > }
> > //
> > /* But this synthax works !
> > module prisme(x, y, z, sens){
> > f = [ [0,1,2,3],[3,2,5,4],[4,5,1,0],[0,3,4],[5,2,1] ];
> > c = 2 ;
> > if(sens == 1)
> > polyhedron(
> > points = [ [0,0,0],[x,0,0],[x,y,0],[0,y,0],[0,y,z],[x,y,z] ],
> > faces = f,
> > convexity = c );
> > else if(sens == -1)
> > polyhedron(
> > points = [ [0,0,0],[x,0,0],[x,y,0],[0,y,0],[0,y,-z],[x,y,-z] ],
> > faces = f,
> > convexity = c );
> > else if(sens == 2)
> > polyhedron(
> > points = [ [0,0,0],[x,0,0],[x,y,0],[0,y,0],[0,0,z],[x,0,z] ],
> > faces = f,
> > convexity = c );
> > else if(sens == -2)
> > polyhedron(
> > points = [ [0,0,0],[x,0,0],[x,y,0],[0,y,0], [0,0,-z],[x,0,-z] ],
> > faces = f,
> > convexity = c );
> > }
> > */
> >
> > I don't see my error, perhaps a BUG ?
> > Any idea ?
> >
> > Best regards
> > Luc
>
>
>
>
>
> -----
> Admin - PM me if you need anything, or if I've done something stupid...
>
> Unless specifically shown otherwise above, my contribution is in the
> Public Domain; to the extent possible under law, I have waived all
> copyright and related or neighbouring rights to this work. Obviously
> inclusion of works of previous authors is not included in the above.
>
> The TPP is no simple “trade agreement.” Fight it!
> http://www.ourfairdeal.org/ time is running out!
> --
> View this message in context: http://forum.openscad.org/
> Vector-affectation-seem-not-working-in-test-tp19584p19594.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
>