2D primitives and import() ...?

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

2D primitives and import() ...?

buzz
I'm using import() to bring a dxf into my .scad file, and I wanted to NOT turn it into a 3D object by extrusion...... instead i wanted to use each of the points ( or lines) in the dxf as a coordinate at which to place a set of object/s.....    eg:    import a square dxf, and have openscad put a vertical cylinder at each corner, ( and a simple flat extruded thing ontop ) , and I have a 4 legged table.   change the dxf to a triangle and I have a 3 legged table, etc.     ... or a hexagon dxf gives me a 6 legged table.   

Is this possible, and how?     :-)

I've tried stuff like this and the import works, but the loop doesn't.
works:
import(file = "preimeter.dxf");

doesn't:
v = import(file = "preimeter.dxf");

for(i=[v]) {

echo("foo");
}

Ta,
Buzz.

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566
Reply | Threaded
Open this post in threaded view
|

Re: 2D primitives and import() ...?

nophead
Import of a DXF creates 2D geometry. You can't set an expression equal to geometry. In openSCAD they are two completely different domains. Expressions are evaluated, ultimately from constants, and the results used to construct the geometry, but never the other way round.


On 5 July 2013 02:31, buzz <[hidden email]> wrote:
I'm using import() to bring a dxf into my .scad file, and I wanted to NOT turn it into a 3D object by extrusion...... instead i wanted to use each of the points ( or lines) in the dxf as a coordinate at which to place a set of object/s.....    eg:    import a square dxf, and have openscad put a vertical cylinder at each corner, ( and a simple flat extruded thing ontop ) , and I have a 4 legged table.   change the dxf to a triangle and I have a 3 legged table, etc.     ... or a hexagon dxf gives me a 6 legged table.   

Is this possible, and how?     :-)

I've tried stuff like this and the import works, but the loop doesn't.
works:
import(file = "preimeter.dxf");

doesn't:
v = import(file = "preimeter.dxf");

for(i=[v]) {

echo("foo");
}

Ta,
Buzz.

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566
Reply | Threaded
Open this post in threaded view
|

Re: 2D primitives and import() ...?

nophead
Having said that the readme says "In addition to 2D paths for extrusion it is also possible to read design parameters from DXF files. " but I have no idea how you do that.


On 5 July 2013 03:31, nop head <[hidden email]> wrote:
Import of a DXF creates 2D geometry. You can't set an expression equal to geometry. In openSCAD they are two completely different domains. Expressions are evaluated, ultimately from constants, and the results used to construct the geometry, but never the other way round.


On 5 July 2013 02:31, buzz <[hidden email]> wrote:
I'm using import() to bring a dxf into my .scad file, and I wanted to NOT turn it into a 3D object by extrusion...... instead i wanted to use each of the points ( or lines) in the dxf as a coordinate at which to place a set of object/s.....    eg:    import a square dxf, and have openscad put a vertical cylinder at each corner, ( and a simple flat extruded thing ontop ) , and I have a 4 legged table.   change the dxf to a triangle and I have a 3 legged table, etc.     ... or a hexagon dxf gives me a 6 legged table.   

Is this possible, and how?     :-)

I've tried stuff like this and the import works, but the loop doesn't.
works:
import(file = "preimeter.dxf");

doesn't:
v = import(file = "preimeter.dxf");

for(i=[v]) {

echo("foo");
}

Ta,
Buzz.

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566



_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566
Reply | Threaded
Open this post in threaded view
|

Re: 2D primitives and import() ...?

Jeff Senn-2
Possibly that refers to the "dxf_dim" function which allows you to read "dimensions" out of the DXF file.
I don't see how that can help Buzz very much though...

On Jul 4, 2013, at 10:37 PM, nop head <[hidden email]> wrote:

Having said that the readme says "In addition to 2D paths for extrusion it is also possible to read design parameters from DXF files. " but I have no idea how you do that.


On 5 July 2013 03:31, nop head <[hidden email]> wrote:
Import of a DXF creates 2D geometry. You can't set an expression equal to geometry. In openSCAD they are two completely different domains. Expressions are evaluated, ultimately from constants, and the results used to construct the geometry, but never the other way round.


On 5 July 2013 02:31, buzz <[hidden email]> wrote:
I'm using import() to bring a dxf into my .scad file, and I wanted to NOT turn it into a 3D object by extrusion...... instead i wanted to use each of the points ( or lines) in the dxf as a coordinate at which to place a set of object/s.....    eg:    import a square dxf, and have openscad put a vertical cylinder at each corner, ( and a simple flat extruded thing ontop ) , and I have a 4 legged table.   change the dxf to a triangle and I have a 3 legged table, etc.     ... or a hexagon dxf gives me a 6 legged table.   

Is this possible, and how?     :-)

I've tried stuff like this and the import works, but the loop doesn't.
works:
import(file = "preimeter.dxf");

doesn't:
v = import(file = "preimeter.dxf");
for(i=[v]) {
echo("foo");
}

Ta,
Buzz.

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566