• Home
  • Products
  • Blog
  • Contact
  • About
  • Future Products
  • Cadquery
Parametric Products, LLC Store

blog

Enhanced Planes for Onshape

6/11/2016

 
If you use Onshape a lot, you know that planes are the center of your universe.  You need one to create a sketch, and since Onshape doesnt have 3d sketching, you always need to start a sketch with a 2D plane.

There are already lots of ways to create planes in Onshape, but  I quickly found I wanted more.  One example I ran into was creation of tangent planes on curved surfaces.   Consider this situation:
Picture
This is a simple shape with a draft on the side.  I want to create a plane tangent to surface 1, parallel to plane 2. How can I do that?  With stock Onshape, I need to follow these steps:
  1. Create a midplane between surfaces 3 and 4
  2. Create a sketch on that plane
  3. Draw a line on the sketch in a direction perpendicular to plane 2
  4. Project the draft surface onto the sketch, using the 'use intersections' tool
  5. place a vertex at the intersection of this curve and the line from step 3
  6. finish the sketch
  7. use tangent at point to create a plane on surface 1, at the vertex created in step 5

Phew! Really? Just to create a single plane? I'd like to be able to simply select plane 2, and surface 1, and create a plane tangent to the surface, and 'aligned' with plane 2.  But what does 'aligned' mean?

If surface 1 were it a cylinder, 'aligned' would be easy to define:  we want a plane tangent to the surface, and parallel with surface #2. But surface 1 is a cone.  Here, we can define 'aligned' as a plane who's normal vector is only different than the reference plane in only one direction. Or, put another way-- the plane with normal vector as close as possible to the reference plane.

We created the Enhanced Planes add-in for Onshape  to meet this need.  Here it is in action
Picture
This is the desired result.  Tangent plane in one step. Score.

Enhanced planes makes quick work of several other scenarios that are harder than they should be:
  1. Create a plane by selecting > 1 linear edge, or a single arc. This comes in handy when the edges were not defined in the same plane already
  2. Create a plane having a normal vector aligned with an edge tangent vector
  3. Create a plane tangent to a curved surface, and aligned with another reference plane. This saves about 4 steps using core product, where you need to create a plane and then use the intersection functionality to compute the point on the surface
  4. Create  a plane tangent to a curved surface, at given surface parameters. This is handy when you want a tangent plane at the center of a surface
  5. Create multiple offset planes or midplanes. Core product allows creating a single mid-planes and offset planes, but sometimes I want to create a whole array, not just one.

If you find these useful, give Enhanced Planes a try.  

​Do you have a scenario that creating a plane was harder than it should be?
​If so, let us know! 

Working faster in Onshape with FeatureScript add-ins

6/5/2016

 
As an Onshape user, sometimes I find that things should just be a little easier. It's not that the core product cannot work-- it just takes more steps than I want.

A good example is creating a sphere. That should be pretty easy right?   Surprisingly, creating a sphere is missing in Onshape.  You can do it using these steps:
  1. Create a sketch
  2. Draw a center line
  3. Draw a half circle
  4. Add a dimension
  5. Revolve the sketch

It's not difficult, but if you add lots of little examples like this up, it ends up taking longer to draw something than I'd like.

All is not lost. An Onshape tool called Featurescript has recently been released, that we can use to fill the gaps. Using Featurescript, it is possible to create an addin that provides the one-step sphere I'd like.

Making a sphere add-in
When finished it should  look like this:
Picture
I'd like to provide a vertex and a radius as input (2).  And, I'd like it available on my toolbar for quick access (1).  

How do you do it? Turns out, its not very difficult. First, create a new feature:
Picture
Next,  change the template for our needs:
Picture
We've modified the template as follows:
  1. We've just modified the auto-generated code to name this a Sphere.
  2. Accept a vertex as input. This will be the center of the sphere.
  3. A radius
  4. call a function called makeSphere that actually creates the sphere. 

But what about this makeSphere function?  Here, we need  to write the code that makes a sphere. It is simply the code version of what you would do by hand.   It ends up being about 25 lines of code:
Picture
The steps are as follows:
  1. create a sketch
  2. create a semi-circular shape
  3. draw a rotation axis
  4.  revolve the sketch around the axis
  5. delete the sketch so it doesn't clutter the work space.

Once this is saved, you can use this feature from Part Studios inside of your Onshape document. First, create a sketch, and put a vertex somewhere.  Then, select the vertex and use the feature selector to choose your new feature:
Picture

Now you should be able to use the new sphere function.   But what about that last little bit:  adding it to your toolbar?  

​To do that, you first need to create a version (1),  and then add this feature to your toolbar (2).
Picture

​You can name the version anything you want.  Onshape requires that you use a version when you add the feature to your toolbar, you select which version you want. That way, you can change the feature and not worry about breaking older documents.

If you already have an Onshape account, you can see the full example we've worked through here:

If you would like to create spheres in your own projects, don't use this demo project, though.  There is a better version of the sphere feature in our  Torus, Sphere, and Dome feature for Onshape , which allows you to select multiple vertices to create multiple spheres at once.   You an use it for free, to save the effort of creating it yourself.

Other things that should be easier

There are several other things we wish were easier in Onshape too, like:
  1. Create planes a lot more easily, especially tangent planes on surfaces
  2. Create 3D points from imported text
  3. Create multiple offset or midplanes in one step
  4. Create washers in one step

We've created features that implement these as well, and we'll blog about these more in the future.  If you are interested in trying them out they are all available for free in our online catalog.

    Dave Cowden

    Developer and owner of Parametric Products, LLC

    Archives

    July 2016
    June 2016
    May 2016

    Categories

    All
    Features

    RSS Feed

Copyright (c) 2016 Parametric Products, LLC. All rights reserved.
  • Home
  • Products
  • Blog
  • Contact
  • About
  • Future Products
  • Cadquery