Curveaceous galore

Hi,
Recently,
Jimmy Haze sent me this script.
Have fun.
CurvesG

Wow!
Pretty good script.
I like the preview feature!
The script saves some work and it’s fun to play with.
What about image based curve generation? :slight_smile:
Thanks for sharing!

A nice addition!
Basic shapes at the click of a mouse.

Now I don’t have to go into Illustrator to get my basic shapes.

Syziph, this script is open for development.

Atom, thanks for the reply,
Jimmy Haze is a great script writer.
I nearly fell off my chair after he emailed me with this script.
(& the New ANT Another Noise Tool, now in Blender 2.49)
The Curve script is really great stuff.
Someone like yourself, could probably add some more presets.
It would be most welcome if you did.
Enjoy.

i’m amaze with this preview - first time i see this in blender

can somone give an idea where i can locate this preview in the script?

and is there more doc available for this

i’d like to understand it and use it to do script with a preview in it

is there a way to size it larger for instance ?
or hve more colors in the graph ?

it’s a great way to preview things beofere commiting to the dwg in blender

Happy blendering

hi RickyBlender.
I only received the script a few days ago.
So i have not done docs for it yet.

1 - code for futur curves not completed

i was begining to look at the coding and i think there are some curves that are missing

  • some of the codes included in but not yet completed

this could be added at a later date i guess?

check out this proc

3DCurve: Cycloid: Cycloid, Epicycloid, Hypocycloid

def CycloidCurve

at line 665

this does not seems to be used in this script but looks like the beginning of a futur addition
which would be interesting to see !

2 - Preview window

but i still don’t see how the preview is done - that’s a mystery
hope you can give us some details how it is done cause it’s very interesting

i would like to use this feature in a script for other type of curves i’d like to do
and preview would be a plus to see the shape of the curve!

Thanks
Happy blendering

Okay, this script is just plain groovy! It’s not “rocket-science” functionality; just something simple and easy to use that will greatly speed up an often-needed task.

It could be argued that this sort of thing should be built into Blender in the first place. But for now I’m very happy using this script.

Kudos to the author!

Very nice script!

@Ricky: The preview is done via OpenGL. You can issues opengl commands from your script to draw in the script panel.

I too went “Wow!” when I fully realized you can draw whatever you imagine with your script. We are not just limited to those clunky old Blender buttons.

This is how I created the newly released list box for Blender.

Very nice script.
I’ve been playing with it a little bit and there is a minor bug in the cog wheel option when both middle and bevel are set to their extreme values (either zero or one). The curve won’t be correctly filled.
Reproduction steps:

  • start script
  • select cog wheel shape
  • set middle to 1.0
  • set bevel to 1.0
  • go

Two suggestions to improve the script:

  • list the shapes alphabetically
  • when a user is in editmode (and the object is a curve) add the curve to the current object instead of creating a new one. As it is currently you have to join the two curves (ctrl+J) and re-enter editmode, breaking the workflow.

But let me repeat again with how I started this post: very nice script. The 3D curve shapes are also a good option and everything is remarkably easy to use while there are a lot of different options and settings.

The helix seems kind of quirky to me. Why does it have a line through it? It should be an open curve. I notice other shapes have lines through them as well. It would be nice if there was an option for open or closed curve.

hi,
I’m glad you like the script.
So do I.
The script was generously provided “as is”
Any additions, new features, custom shapes, are completely welcome.
If you wish to add to this script feel free to do so here!
Thanks.

@Atom

About Opengl

ok is there any doc or Tut on how to do that?

not certain how to procede and what are the other options if any exist
seem to be very intersting way to show things in GUI

is it possible to show pic there too
and what about the size of the GUI still limited ?

i check out the link to the Scrollable list but you cannot move the Side BAr to move along the list?

and how is it done ?

Thanks

@ Atom:

You need to press the [Curve] button and then de-activate the [Cyclic] button.

Great script. Lots of fun to play with.

@Jarell: I’ll give that a try.

@Ricky: OpenGL is a standard, just go to a bookstore and get any book on it. What is cool about OpenGL is that it is implemented in many places, including most major game engines. So becoming familiar with OpenGL is very useful down the road.

I discovered this code, written in C to draw a rounded rectangle using OpenGL.
http://www.goldenstudios.or.id/forum/showthread.php?tid=1387&pid=18789#pid18789

I was able to convert it to Blender python with very little code change. Sorry for drifting off topic here…


    def roundedRectangle(self, radius, color):
        myPI = 3.14159
        x = self.x1
        y = SCREENHEIGHT-self.y1-26
        w = self.width
        h = self.height
        
        glDisable(GL_TEXTURE_2D)
        glColor4f(color.r,color.g,color.b,0.5)
        glLineWidth(1.0)
    
        glBegin(GL_POLYGON)
    
        glVertex2f (x+radius, y)
        glVertex2f (x + w-radius, y)
        for t in frange(float(myPI * 1.5),float(myPI * 2.0), 0.1):
            sx = float(x +w - radius + math.cos(t) * radius)
            sy = float(y + radius + math.sin(t) * radius)
            glVertex2f (sx, sy)
    
        glVertex2f (x + w, y+radius)
        glVertex2f (x + w, y+h-radius)
        for t in frange(0.0,float(myPI * 0.5), 0.1):
            sx = float(x + w - radius + math.cos(t) * radius)
            sy = float(y +h -radius + math.sin(t) * radius)
            glVertex2f (sx, sy)
    
        glVertex2f (x + w -radius, y+h)
        glVertex2f (x +radius, y+h)
        for t in frange(float(myPI * 0.5),myPI, 0.1):
            sx = float(x  + radius + math.cos(t) * radius)
            sy = float(y + h - radius + math.sin(t) * radius)
            glVertex2f (sx, sy)
    
        glVertex2f (x, y+h - radius)
        glVertex2f (x, y +radius)
        for t in frange(myPI,float(myPI * 1.5), 0.1):
            sx = float(x + radius + math.cos(t) * radius)
            sy = float(y + radius + math.sin(t) * radius)
            glVertex2f (sx, sy)
    
        glEnd()

but was this code in python or in C?

i mean i was looking for the code in the script where this is done
and cannot locate it ?

so if it is done in python there must be some doc on this opengl thing somewhere

it looks very nice in the GUI that’s certain
and like to learn as much as i can about it

if you want i can open another thread on this subject if needed !

but i think it is part of this script and good to be discussed here
other peoples might interested in this subject too
and how to do it

Thanks
Happy blendering

As a chinese cook once said to me as I was washing dishes…

Open you eye.

Draw 2D Shape In G.U.I.:

Line #1133

The author is just drawing lines. It looks quite efficient too because the author is using the same line data that created the 2D shapes inside the Blender memory space inside the GUI as well. No big trick, he does a black rectangle fill and then cycles through the point data drawing yellow lines.

Nice script, saves a lot of edges to curves converting, and can get really nice random/noisy curves, as well as helix/spirals and whatever you want.

Sometimes I have to reload the script to get the basic shapes and reset it.