CamBam
News:
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
June 28, 2017, 14:55:36 pm


Login with username, password and session length


Pages: [1] 2
  Print  
Author Topic: Squircle Plugin  (Read 5119 times)
GeoffreyGRoy
Storm Trooper
***
Offline Offline

Posts: 119


View Profile
« on: January 18, 2015, 09:09:04 am »

I am posting the first version on my "Squircle" plugin.  A squircle is a "rounded" square or rectangle - a shape somewhere between a square (or rectangle) and a circle (or ellipse) based on the selection of a power value.  See http://en.wikipedia.org/wiki/Squircle for details.

This plugin might be useful  to generate interesting shapes for model building in CamBam.

The plugin generates a Polyline (at Z=0) based on the set parameters (see sample image attached) and inserts it into the currently active model layer.  This polyline can be further edited as required.

Please let me know of any bugs, or issues, or useful improvements.

Geoff

Note: The "Pro" version is also now available:

* SquirclePlugin-1.0.1.zip (107.48 KB - downloaded 194 times.)

* SquircleSample.jpg (44.97 KB, 726x403 - viewed 226 times.)
* SquircleProPlugin-1.0.1.zip (215.62 KB - downloaded 96 times.)
« Last Edit: January 24, 2015, 08:59:40 am by GeoffreyGRoy » Logged
EddyCurrent
CNC Jedi
*****
Offline Offline

Posts: 2906



View Profile
« Reply #1 on: January 18, 2015, 14:59:02 pm »

What about making it so that algorithms could be applied to different 'primitive shapes' ?
So there would be a menu of some sort where primitives could be selected such as;

circle
square
triangle
polygon

I'm thinking that different primitives would yield shapes such as, stars, polygons with curved sides, etc. I have no idea what they would produce if the right equations were applied. Whatever they produced the key point would be, they would be hard to draw by hand.
Logged
Bubba
CNC Jedi
*****
Offline Offline

Posts: 2143



View Profile
« Reply #2 on: January 18, 2015, 15:18:52 pm »

Along the line of Eddies thinking.

 I would like to see the hex as on the bolt head. There were couple of times I needed it and I'm sure others run in to it as well.

Cheers.

BTW, NICE plugin. Thanks.
Logged
GeoffreyGRoy
Storm Trooper
***
Offline Offline

Posts: 119


View Profile
« Reply #3 on: January 18, 2015, 22:49:18 pm »

Thanks for the comments. A polygon plugin has already been posted at:

(http://www.cambam.co.uk/forum/index.php?topic=2959.msg18551#msg18551)

 by rodneyk    and I did not see any real justification for duplicating those capabilities.

thanks

Geoff
Logged
lloydsp
CNC Jedi
*****
Online Online

Posts: 6902



View Profile
« Reply #4 on: January 19, 2015, 00:15:02 am »

Geoff,
I think he means a polygon "squircled".

Lloyd
Logged

"Pyro for Fun and Profit for More Than Fifty Years"
kvom
CNC Jedi
*****
Offline Offline

Posts: 1334


View Profile
« Reply #5 on: January 19, 2015, 02:44:39 am »

The thing to remember here is that this is a form of a "super ellipse", and the fact that it's somewhat rectangular is a function of the exponent (4).  Different exponents give different shapes, and the squircle does not derive from a rectangle.
Logged
EddyCurrent
CNC Jedi
*****
Offline Offline

Posts: 2906



View Profile
« Reply #6 on: January 19, 2015, 08:39:27 am »

The thing to remember here is that this is a form of a "super ellipse", and the fact that it's somewhat rectangular is a function of the exponent (4).  Different exponents give different shapes, and the squircle does not derive from a rectangle.

Yes so I'm talking sbout adding forms of 'super square', 'super triangle', 'super polygon', etc. and I'm saying I can't imagine what would be produced without trying it.
Logged
Bubba
CNC Jedi
*****
Offline Offline

Posts: 2143



View Profile
« Reply #7 on: January 19, 2015, 12:33:10 pm »

Thanks for the comments. A polygon plugin has already been posted at:

(http://www.cambam.co.uk/forum/index.php?topic=2959.msg18551#msg18551)

 by rodneyk    and I did not see any real justification for duplicating those capabilities.

thanks

Geoff



It is apparent that I missed that plugin. That why I was asking for a HEX.. Oh , never mind.. Don't worry about it Grin Grin
Logged
BR52
Wookie
****
Offline Offline

Posts: 299



View Profile
« Reply #8 on: January 19, 2015, 18:36:01 pm »

Geoff
If you know how to make other geometric shape, you are free to make your way.
Never mind that the rodneyk ever done.

In Portuguese "O rodneyk pisou na bola!"

   Armando
Logged
GeoffreyGRoy
Storm Trooper
***
Offline Offline

Posts: 119


View Profile
« Reply #9 on: January 19, 2015, 22:50:24 pm »

Dear Armando and others

There are, of course, many different possibilities for generating 2D shapes (with both straight and curved edges).  There will always be particular shapes that might be useful, but it is unlikely that they can be described from a small number of parameters. Sometimes families of shapes are possible (like circles, ellipses, regular polygons and even squircles!) as these can be readily generated from a small number of parameters, and as a result these primitives are often provided in CAD packages.

In general, therefore, the only practical approach is to construct more complex shapes is from combinations of more fundamental primitives (like lines, polygons, circles, perhaps splines and even "free-hand drawings"), or from purpose built code.

It is therefore not really practical to extend my Squircle Plugin to produce more general shapes.

Geoff
Logged
kvom
CNC Jedi
*****
Offline Offline

Posts: 1334


View Profile
« Reply #10 on: January 20, 2015, 12:28:17 pm »

The most straightforward change that could be done is to have separate exponents for the X and Y values.

See this page for various possibilities:  http://mathworld.wolfram.com/Superellipse.html

You can also get more varied shapes by using the polar-coordinate version of the formula.  Here's a page that will let you play around with it graphically.  http://demonstrations.wolfram.com/SuperellipseShapes/
« Last Edit: January 20, 2015, 12:35:19 pm by kvom » Logged
Bob La Londe
CNC Jedi
*****
Offline Offline

Posts: 2795


^ 8.5 pounds on my own hand poured bait.


View Profile WWW
« Reply #11 on: January 20, 2015, 18:08:21 pm »

Thanks for the comments. A polygon plugin has already been posted at:

(http://www.cambam.co.uk/forum/index.php?topic=2959.msg18551#msg18551)

 by rodneyk    and I did not see any real justification for duplicating those capabilities.

thanks

Geoff



It is apparent that I missed that plugin. That why I was asking for a HEX.. Oh , never mind.. Don't worry about it Grin Grin

Also, while much slower it was always possible to generate a uniform polygon through a few more steps. 

Draw a circle.
Draw point list by dividing circle. 
Draw lines from point to point. 
Connect lines. 
Rotate polygon and position as needed. 


Logged

Getting started on CNC?  In or passing through my area?
If I have the time I'll be glad to show you a little in my shop. 

Some Stuff I Make with CamBam
http://www.CNCMOLDS.com
GeoffreyGRoy
Storm Trooper
***
Offline Offline

Posts: 119


View Profile
« Reply #12 on: January 24, 2015, 08:57:40 am »

Many thanks for the feedback, and especially the reference to the Wolfram Research web site from kvom.

I have now created a "Pro" version of the plugin ("Pro" because it is is a bit more complicated to select the desired parameters!).

This new version includes the first "Simple" option also, but now a "Complex" option with 6 parameters to define the shape.  Some experimentation is required to get interesting/useful shapes - but many are possible.  Potential users might want to check out the Wolfram Research we site (http://demonstrations.wolfram.com/SuperellipseShapes/) to get some hints for parameter values.

Please let me know of any bugs.

thanks

Geoff

* SquircleProPlugin-1.0.1.zip (215.62 KB - downloaded 93 times.)
Logged
BR52
Wookie
****
Offline Offline

Posts: 299



View Profile
« Reply #13 on: January 24, 2015, 11:35:05 am »

Hi Geoff

Good idea, putting complex equation in your plugin, congratulations!
I said to you that is free to make, see here.
http://www.cambam.co.uk/forum/index.php?PHPSESSID=a0196dce034c5fa3e34734540b874e12&topic=4609.0

Please put your source code here.

   Armando
Logged
dh42
Administrator
CNC Jedi
*****
Offline Offline

Posts: 4443



View Profile WWW
« Reply #14 on: April 28, 2016, 18:20:08 pm »

Hello,

I'm playing with the plugin, and I see that when I click on Make Polyline, the polyline is added to the list in the layers tree, but it is not drawn on the screen until I move the squircle plugin windows (on Win XP, not tested on 7)

++
David
Logged
Pages: [1] 2
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2013, Simple Machines

Valid XHTML 1.0! Valid CSS! Dilber MC Theme by HarzeM
Page created in 0.155 seconds with 18 queries.

Copyright © 2008 HexRay Ltd. | Sitemap