• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

Visio Guy

Smart graphics for visual people




  • Home
  • Hire Me
    • Hire Me
    • Résumé
  • Products
    • Products
    • Bubble Revision Shape
    • Layers to Pages Utility
    • Rack Unit Dimension Line
    • Radial Elements Tool with up to 100 Wedges
    • Text on a Circle Visio SmartShape
  • Index
    • Articles by Date
    • YouTube – VisioGuy
    • Download Information
    • Suggestion Box
    • Shop
    • Visio Art
    • Visio Links
    • – Visio Shapes & Stencils
    • – Visio Templates & Drawings
  • About
    • About
    • Donate
    • GitHub
    • jsFiddle
    • Reading List
    • Subscribe & Follow
      • – E-mail
      • – facebook
      • – Twitter
      • – RSS
    • Privacy Policy
  • Discussion Forum
You are here: Home / Visio Content / Shapes / Visio Squircles

Visio Squircles

April 2, 2009 By Visio Guy 4 Comments

squircle-visio-shapeA couple weeks ago, I briefly glanced at my annoying Facebook page and noticed that people were commenting on the “new look”, which I was fortunate enough to not notice.

What did catch my eye was a comment from one friend, who noted; “Hey, the new Facebook has squircles!” Then another replied; “Yes, squircles are so Web 2.0!”

Naturally I was put off by how folks try to Out-clever-two-point-oh each other on Facebook, but I was nonetheless curious about squircles, because they sounded…well…visual!

Scandal! It’s Not a True Squircle

So I immdiately set out to find out what a squircle was, and create a Visio version of one, if possible.

It turns out that squircles are a sort of rounded square.You can read about the details on Wikipedia, but I’ll summarize a squircle as a “circle to the fourth power”. Normally, you would describe a circle as being an x2+y2 kind of beast. A squircle would be what you get if you were to plot x4+y4.

The ShapeSheet behind each Visio shape is good at representing trigonometric curves, and you can use algebra to create expressions for each point in a shape. But it isn’t good at creating arbitrary curves and plotting innumerable points. So I had to come up with an approximation of r4, that could be expressed as circular arcs or elliptical arcs, or splines or nurbs.

Since my nurb- and spline-math is very rusty, I settled on creating a squircle from eight circular arcs, each arc tangent to the next. I think it looks pretty good, but see for yourself:

visio-squircle-tangents

While the shape is composed of eight circular arcs, there are only three unique radii for these arcs, since the corner curves are all the same, the left and right sides are the same, and the top and bottom are the same.

In the illustration above, I’ve highlighted one set of unique arc-segments and colored them red, green and blue. They are all circular arcs, but they all have (potentially) different radii. Where they meet, they are tangent. So the red arc is tangent to the green arc, and the blue arc is tangent to the other end of the green arc.

Also shown are the radii for each arc. When the shape is stretched to be rectangular, the red and blue radii no longer remain the same. But the corner radii always remain the same–as specified by the shape’s user.

Creating the Squircle

To calculate the geometry for the shape, I had to resort to some lengthy, but not complicated, algebra and trigonometry. For this squircle shape, we choose a width and height, and we specify the arc and radius of the corners. These knowns, along with the constraint of tangency at each arc intersection make this a solvable system. Here’s the design- and calculation scribblings for the masochistic:

homeworkclick to view larger image

The trick to translating complicated math like this into the ShapeSheet is to use User-defined cells. When you sketch out your geometry, give the important bits good-but-short names. As you do the algebra, notice any long-but-repeated expressions and turn them into variable- or constants to make your formulas shorter. Now all of the variables and constants become User-defined cells.

In my squircle shape, I’ve got 13 User-defined cells. They have names like this:

User.alpha
User.r
User.w
User.h
User.bx
User.by
User.br
User.rx
User.ry
User.k
User.cosb
User.sinb

If you ignore the “User” bits, it starts to look a lot like eighth-grade algebra class, doesn’t it? The end-result of all this substitution and simplification is a very compact and clean Geometry section. This is what the actual arc-definitions look like for our squircle’s geometry-section:

squircle-shapesheet-geometry

click to view larger image

Using the Squircle Shape

When using this shape, we specify both the angle and the radius of the corner arcs (the green ones!) You do this via the Shape Data Window which you can access under the View menu.

We can see what happens as we vary the angle at the corner. Below, I’ve shown the shape as both a “squircle” (a square) and a “circtangle” (a rectangle). When the angle goes beyond 90°, things start to get interesting!

angle-comparisons

click to view larger image

Similarly, we can experiment with the radius at the corner. In the image below, I’ve expressed the radius as a function of the width of the shape, since absolute values wouldn’t tell you anything useful:

radii-comparisons

click to view larger image

Get the squircle!

Download “Visio Squircle Shape”

s!Aj0wJuswNyXlhiga2wRAW8hZ_jyy – Downloaded 1508 times – 103.00 B

And be sure to let us know what you are doing with the Squircle by leaving a comment below. We’d love to know what uses you put him to!

We whipped up a few flowcharts with him, just to see if we could. Here are some samples using Visio 2007’s themes feature, including the custom Battlezone Theme.

squircle-flowcharts

click to view larger image

  • Tweet
  • More
  • Pocket
  • Share on Tumblr
  • Print
  • Email

Related posts:

  1. Off-center Radial Fill Effect
  2. SmartShape Tutorial: Fading Trees
  3. Run Circles Around Your Text With the Circle-text Title SmartShape
  4. Visio Spectrum Shape
  5. Repeating Diamond Title Visio Shape

Filed Under: Shapes Tagged With: Artistic Effects, Geometry, SmartShapes, User-defined Cells

Previous Post: « Get Amazing Results With Hidden Function (April Fool’s)
Next Post: Path Analysis in Visio »

Reader Interactions

Comments

  1. philippe c says

    April 2, 2009 at 9:27 am

    And to combine ellipses and rectangles : http://www.piethein.com/usr/piethein/HomepagUK.nsf

  2. Visio Guy says

    April 2, 2009 at 9:45 am

    Nice, Philippe, I’ve not made a circtangle, I’ve created a SUPERELLIPSE!

  3. Neil says

    November 16, 2011 at 6:41 pm

    I’d like to learn how to use NURBS and splines. Any suggestions on where to look?

  4. Visio Guy says

    November 16, 2011 at 9:38 pm

    Hi Neil,

    If you’re using automation, check out the Page.DrawNURBS method.

    If you’re in the ShapeSheet, then look at the different types of Geometry sections. There is a corresponding NURBS function that goes along with a NURBSTo geometry row.

Leave a Reply Cancel reply

Primary Sidebar

Buy Über Bubble Revision Shape
Purchase

Categories

Buy my book!

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org

Tag Cloud

A/V Artistic Effects BPM Code Connectors Control Handles Countries Custom Patterns Custom Properties Data Graphics Data Linking Data Visualization David Edson David Parker Fill Format Formulas Functions Geometry Gradient Images Links Maps Multi-shapes Network Programming repeating shapes Resources Right-Click Actions Scale Shape Data ShapeSheet ShapeSheet Formulas ShapeSheet Functions SharePoint shiny SmartShapes Sport Sports Text Themes Tools Transparency User-defined Cells Visio 2007 Visio SmartShapes

Top Posts & Pages

  • - Visio Shapes & Stencils
  • - Visio Templates & Drawings
  • Amazon AWS Visio Shapes
  • Dynamic Updating Org Charts in Visio!
  • Text on a Circle Visio Shape
  • Bubble Revision Shapes
  • Crayon Visio Network Shapes, Revisited
  • Map of World
  • Sankey Diagram Shapes for Visio
  • AV Engineering Diagrams with Symbol Logic ECAV

www.visguy.com - Visio Guy - since 2006

 

Loading Comments...