discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

a curve logo

JJ
Johan Jonker
Mon, Dec 21, 2015 12:57 PM

I like to have a handwritten logo in my 3D printed objects.
With surface it is possible to convert a png file into a 3D logo that you
can add or substract from flat surfaces. But I liked to have to logo on a
curved object.
So I made a curved logo in this way:

http://forum.openscad.org/file/n15260/democurvedlogo.png

The code is as follows:
//------------------------------------------------
// module to make a curved logo from a png file
//------------------------------------------------

curvedlogo(20,20);

module curvedlogo(diameter,lenght)
{

$fn=60;

translate([0,0,-diameter/2])
intersection()
    {
        // create a tube with 2* lenght and diameter
        difference()
        {
            rotate(90,[1,0,0]) 
              translate([0,0,-lenght]) 
               

cylinder(lenght*2,diameter/2+4,diameter/2+4,center=false);
rotate(90,[1,0,0])
translate([0,0,-lenght-0.1])

cylinder(lenght2+0.2,diameter/2,diameter/2,center=false);
}
// create a 3D logo with height diameter
2
translate([0,0,diameter])
resize([lenght, lenght, diameter])
surface(file = "logob.png", center = true, invert=true,
convexity = 5);

}

}

--
View this message in context: http://forum.openscad.org/a-curve-logo-tp15260.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

I like to have a handwritten logo in my 3D printed objects. With surface it is possible to convert a png file into a 3D logo that you can add or substract from flat surfaces. But I liked to have to logo on a curved object. So I made a curved logo in this way: <http://forum.openscad.org/file/n15260/democurvedlogo.png> The code is as follows: //------------------------------------------------ // module to make a curved logo from a png file //------------------------------------------------ curvedlogo(20,20); module curvedlogo(diameter,lenght) { $fn=60; translate([0,0,-diameter/2]) intersection() { // create a tube with 2* lenght and diameter difference() { rotate(90,[1,0,0]) translate([0,0,-lenght]) cylinder(lenght*2,diameter/2+4,diameter/2+4,center=false); rotate(90,[1,0,0]) translate([0,0,-lenght-0.1]) cylinder(lenght*2+0.2,diameter/2,diameter/2,center=false); } // create a 3D logo with height diameter*2 translate([0,0,diameter]) resize([lenght, lenght, diameter]) surface(file = "logob.png", center = true, invert=true, convexity = 5); } } -- View this message in context: http://forum.openscad.org/a-curve-logo-tp15260.html Sent from the OpenSCAD mailing list archive at Nabble.com.
P
Parkinbot
Mon, Dec 21, 2015 2:06 PM

Good approach! If there was a function importing data into a matrix, one
could do really crazy things!

--
View this message in context: http://forum.openscad.org/a-curve-logo-tp15260p15261.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

Good approach! If there was a function importing data into a matrix, one could do really crazy things! -- View this message in context: http://forum.openscad.org/a-curve-logo-tp15260p15261.html Sent from the OpenSCAD mailing list archive at Nabble.com.
MK
Marius Kintel
Mon, Dec 21, 2015 2:31 PM

On Dec 21, 2015, at 07:57 AM, Johan Jonker johangjonker@zonnet.nl wrote:

I like to have a handwritten logo in my 3D printed objects.
With surface it is possible to convert a png file into a 3D logo that you
can add or substract from flat surfaces. But I liked to have to logo on a
curved object.

surface() tends to be very slow.
A better approach would be to trace the png into a vector outline.

We’re working on such a built-in function, see here: https://github.com/openscad/openscad/pull/1110

There are also external tools for this:
http://aggregate.org/MAKE/TRACE2SCAD/
http://chaaawa.com/stencil_factory_js/

-Marius

> On Dec 21, 2015, at 07:57 AM, Johan Jonker <johangjonker@zonnet.nl> wrote: > > I like to have a handwritten logo in my 3D printed objects. > With surface it is possible to convert a png file into a 3D logo that you > can add or substract from flat surfaces. But I liked to have to logo on a > curved object. surface() tends to be very slow. A better approach would be to trace the png into a vector outline. We’re working on such a built-in function, see here: https://github.com/openscad/openscad/pull/1110 There are also external tools for this: http://aggregate.org/MAKE/TRACE2SCAD/ http://chaaawa.com/stencil_factory_js/ -Marius
JJ
Johan Jonker
Mon, Dec 21, 2015 3:44 PM

That right it is very slow. It helped when I reduced the complexity of the
logo and first made and slt file of the logo, simplified it using Meshlab
and then import it.

Here is the result:
http://forum.openscad.org/file/n15263/barrel_met_logo.png

--
View this message in context: http://forum.openscad.org/a-curve-logo-tp15260p15263.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

That right it is very slow. It helped when I reduced the complexity of the logo and first made and slt file of the logo, simplified it using Meshlab and then import it. Here is the result: <http://forum.openscad.org/file/n15263/barrel_met_logo.png> -- View this message in context: http://forum.openscad.org/a-curve-logo-tp15260p15263.html Sent from the OpenSCAD mailing list archive at Nabble.com.
N
Neon22
Mon, Dec 21, 2015 7:28 PM

Looks good. Another approach is to use Inkscape and its tools, to vectorise
your bitmap, and then export to openSCAD using a special extension.

  • in inkscape the tool is under the Path menu and is called "Trace bitmap".
    (POTrace does the work and its code is avilable for other projects to
    include).
  • The Extension is under "Generate from Paths" / "Paths to openSCAD".
  • you need to install the Inkscape extension from here:

--
View this message in context: http://forum.openscad.org/a-curve-logo-tp15260p15270.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

Looks good. Another approach is to use Inkscape and its tools, to vectorise your bitmap, and then export to openSCAD using a special extension. - in inkscape the tool is under the Path menu and is called "Trace bitmap". (POTrace does the work and its code is avilable for other projects to include). - The Extension is under "Generate from Paths" / "Paths to openSCAD". - you need to install the Inkscape extension from here: - http://www.thingiverse.com/thing:1065500 -- View this message in context: http://forum.openscad.org/a-curve-logo-tp15260p15270.html Sent from the OpenSCAD mailing list archive at Nabble.com.