Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.
First time visiting? Here are some places to start:- Looking for a certain topic? Check out the categories filter or use Search (upper right).
- Need support? Ask a question to our Community Support category.
- Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
- Be respectful, on topic and if you see a problem, Flag it.
If you would like to contact our Community Manager personally, feel free to send a private message or an email.
Best Of
Routing curve & Control point curve - Introduction of two new features for 3D curve creation
Today we are excited to announce two new features: Routing curve and Control point curve, designed to address a multitude of applications such as pipe routing, wiring, and more generic NURBS curve creation/editing for advanced surfacing.
Executive summary
- The intent is to provide these as public Custom features while we gather your feedback, but in the short/medium term we intend to include these as part of the Onshape native curve toolset.
- Get the features here
- Watch the demo/how-to videos (embedded below)
- Play with this example (public) doc
- And a Chair frame
- This 6-cylinder turbo manifold
- And a Motorbike frame
- Please provide all feedback/issues here in the forum post (NOT in separate tickets). We will respond here.
Examples of usage
There are a number of new and novel UI/UX aspects to this feature. For example we have added a new manipulator to provide 3 translations and 3 rotations and 3 planes control; we have implemented a new Button parameter; and we have introduced a new, more interactive feature dialog for creation/editing. Incidentally, the new manipulator (fullTriadManipulator) and button are available in FeatureScript for use in your own Custom features. In addition, an opPolyline
function has been added, while the existing opFitSpline
has a new optional derivatives parameter. All of this is documented in
The two features share a lot of common code, but are sufficiently different in their respective applications that we decided to separate them into two sibling features.
Each feature has a large number of capabilities and possible workflows, and may seem overwhelming at first. However if you take a few moments to familiarize yourself with the feature set described here and follow along some of our intro tutorials you’ll find they are very powerful AND easy to use. While it is possible to create some incredibly complicated results with a single feature, they are also designed to efficiently do basic tasks - it really is a Swiss Army knife (or Multi-tool depending on your location!)
Feature Summary
Many engineering applications require routed paths or 3D curves in space, such as wiring, pipe routing, skeletons for frames, and advanced 3D curves for surfacing workflows. They share the requirements: create of a series of points, create a reference system, perform easy manipulation of the points (creation and editing), provide control over specific relationships between points, and provide specific attributes governing the shape of the result. The Routing curve feature and Control point curve feature is designed to meet all these needs. The feature dialog (seen below) separates these shape control, references, point creation and editing functions into groups/options/actions in the UI.
Features common to both Routing curve & Control point curve
- Inputs (group)
- Vertex
- Vertices (QLV) - picked vertices or mate connectors
- Edge
- Input (QLV)
- (Additional displayed options are specific to Routing / Control point curve)
- Process (Button)
- CSV
- File reference (reference in document, or in a linked document)
- Data start column (integer 0,1,2…)
- Unit system (list selection)
- Process (Button)
- Vertex
- Closed curve (Boolean) - creates a closed (periodic) curve
- Curve reference (QLV: Mate connector) - the overall CSYS reference for the curve. If left empty the reference will be the Part Studio origin,
- Selected point (READ ONLY) - shows the index/ID of the current selected point. “Zero” is the first point in the curve.
- Delete point/Add point (Button) - deletes current selected point, or adds new point at same location as Current selected point. Add points fully duplicates the current point (except in relative mode where it sets the offsets to 0), so it also keeps the reference, bend radius, derivative and triad orientation
- Reset triad (Button) - resets the manipulator triad if it has been rotated away from initial WCS orientation
- Add point on axis drag (Boolean) - automatically add a new point if the translation axis of the manipulator is dragged (performs the same as Adding a point, then dragging it as a second operation)
- Current point (group)
- Relative to previous point (Boolean) - the X/Y/Z offset values for the point will be relative to the previous point in the curve. Using this option hides the “Point reference” QLV
- Point reference (QLV: Mate connector, vertex, sketch point) - the X/Y/Z offset values will be relative to this point. By default this will be Origin of the Part Studio
- X/Y/Z offset - this displays the current position of the point, and values can also be typed in
- Show reference coordinate system (Boolean) - shows the reference CSYS for the current selected point. This is extremely useful to quickly diagnose/recognize what the X/Y/Z offsets are with respect to. (Often, people will leave the origin as the default but really meant/assumed they were using some other entity as the reference)
- Keep points (Boolean) - creates point entities at the location of all the points in the curve
Features specific to Routing curve
- Interpolated spline vs. Polyline (selection)
- Interpolated spline
- Creates a (degree 3) interpolated spline through all the points
- Polyline
- Creates line segments between each point in the list
- Bend radius (length value) - inserts an arc between each segment of the curve. Default value is 0 (i.e. no bend.) Can be overridden in individual point editing.
- Interpolated spline
- Input
- Edge
- Number of samples (integer) - sample the input edge to create this many points
- Process (Button) - create the points (and thus the curve) from the edge input
- Edge
- Current point
- Derivative (Boolean) - controls the derivative (tangent direction) of the curve at the given point. Use the manipulator to align the derivative (its X axis) as required. The Magnitude parameter affects the “strength” (influence) of the control.
- Override bend radius (Boolean) - controls the bend radius of the polyline at this particular point, overriding the curve bend radius. Only applies to the first and last points if the curve is closed.
- Segment editing - Note: when entering the “Segments” tab, the magenta lines are displayed, representing the segments. The outlined point shown on each segment is a manipulator, not a control point or vertex. Use this point manipulator to select the segment in the actions below:
- Add points - add a number of new points along a given segment. A segment has only start and end points, so this has the effect of subdividing the segment n times.
- Ortho path - create a new path for a given segment that follows a given CSYS’s ortho directions. Choose the segment to edit, a blue outlined box will appear, oriented to the World coordinate system (or other reference selected). Choose the 3 components as denoted by the edges of the box. The new segments (there are now 3 instead of the original 1) will now be aligned with the WCS (or other). Note that this works for both polyline and interpolated spline, though is typically more associated with polyline for pipe routing).
Features specific to Control point curve
- Inputs
- Edge (QLV) - the (single) edge to be approximated
- Approximate spline edge (Boolean)
- Target degree (integer 1…15)
- Maximum control points (integer)
- Tolerance (Length)
- Keep start derivative(Boolean)
- Keep end derivative (Boolean)
- Process (Button) - based on the inputs above, calculate the position/number of control points and knots and construct the curve.
- Approximate spline edge (Boolean)
- Edge (QLV) - the (single) edge to be approximated
- Degree (positive integer < = 15) - assign a new degree to the curve
- Elevate / Decrease (Button) - Elevates the degree by adding a control point(s). (Decrease is vice versa). Note this adding/removing a single control point is only true for Bezier curves. In more general NURBS curves, Elevate adds multiple control points, while Decrease removes multiple control points as the math requires. This is because for NURBS, we subdivide the curve into Bezier segments first, which adds points, then change the degree of the Beziers, then we stitch them together, which add multiplicity to the knots, and finally try to remove as many knots as possible.
- Weights (positive real number) - assign the weight of the Current point. The resultant curve will be therefore be rational
- Knots (group)
- Make knot vector uniform (Button) - updates positions of knots to be uniform. Can be most useful when dealing with complex imported curves
- Knot array (real number) - displays (read-only) the values of all knots in the array.
- Make piecewise Beziers (Boolean)
- Creates curve as a series of Bezier curves each with the degree specified for the overall curve. The shape of this piecewise curve will be identical to the multispan curve, but the control points for each segment will obviously be different from the overall curve.
Demos/How-to videos
Routing curve how-to:
Control point curve how-to:
Tips/FAQ
- Use the Show reference coordinate system (suggest you make a habit to leave it turned on) in order to ensure your point offsets are relative to the intended reference point/vertex/mate connector/origin
- The Current point is the one where the manipulator is being shown. If you select a new point to the the Current point and then hit Delete point, this is the one that will be deleted
- Add point on drag is useful, but remember to turn it off before attempting to edit existing points, otherwise you will be adding extra points leading to confusion.
- Use the Relative to previous point option to “link” points together. This can be helpful when moving multiple points in one drag operation.. They are essentially “constrained”. It is also useful for ensuring the second point remains normal to the previous point - in the case of a pipe starting from a mate connector you will probably want this as the norm. Set Relative to previous point option to be ON and then drag only in Z.
- When editing a point with the manipulator, the origin of the manipulator can be dragged to a new location - if it picks up an implicit location to snap to (implicit mate connector) then this will be the new location. Note that the Point reference does not get updated, just the offsets. If possible, set the Point reference location first, then do the move.
- When using the Derivative control for an Interpolated spline, note that the curve may fail to regenerate if the Magnitude is too large. Try smaller values and/or adjust the direction using the manipulator.
- Points with reference such as Mate connectors or vertices of other features will associatively update if those upstream features are changed. However, due to the explanation in tip #5, it is possible to trick yourself into believing you have chosen a mate connector on a face as a reference point, and then be surprised that the point did not update… Again, refer to tip #1 to be sure your references are correct and that you don’t have an offset relative to a fixed point like the model Origin.
- The Selection point (read only) display is 0-indexed. I.e. the start of the curve (first point) is “0”
- When using CSV data as reference, be sure to check and set the units appropriately. You’ll have to verify the data beforehand. Also remember that you can either import the CSV file into the document first, OR link to CSV data contained in another document. If you mess up the units you can reselect the correct units, select Overwrite points and hit the Process button again.
- CSV data is processed as a one-shot operation. The points are all relative to the Curve reference (which is the Origin by default, unless you changed it). Yes, after the fact you can individually reassign the individual point references to something else (e.g. Relative to previous point) but there is no associativity to updates made to the CSV data. If you Update the imported CSV file using the regular import update workflow, then you will need to Process the data again, losing any of those previous edits.
- When adding bends to Polylines, if it is not possible to add the bend, the feature will fail to regenerate and segments will be shown in magenta and offending bend in red. A tip is to roughly get the points into place first without the bends, then add them next. To override the bend radius at a specific point between segments there is a checkbox under the X/Y/Z offsets control. Note you can not override the bend radius at the start or end point of an open curve (since this point is not between two segments)
- The Inputs and Current point groups can be collapsed - By collapsing the Inputs group you can save some screen real estate, though it is more likely that the Current point group will need to stay expanded….
- The manipulators for the Segments (which you need for selecting a specific segment) that are displayed when you enter the Segments mode appear the same as the points themselves, though are never displayed at the same time. These are segments of a Polyline in magenta, with manipulators shown: And these are points for a Polyline:
- Don’t forget that you can Reset triad as many times as you like… that’s why the Button is large!
- Where is my Control point curve? The default for a Control point curve is deg 3, which means the minimum number of points you need is 4. Until you have created/selected 4 points you will not see any curve. So, you can either keep selecting points… OR change the degree to something else like “2” or “1”. If your workflow starts by creating a line between two points, then consider setting the degree to “1” first, then select your 2 points. This is the cleanest way and will avoid error states. Info bubbles are provided to remind you of any situations like this:
- By default the Curve reference is the Part studio origin. You can select other references if you like, e.g. a Mate connector. As already mentioned above, make sure to use the Show reference coordinate system so there is no confusion over the Curve reference..
- The manipulator is shown with respect to the Curve reference coordinate system - which by default is the origin and thus aligned with the WCS. If you choose, for example, a mate connector as the Curve reference that is rotated away from WCS, then the manipulator will also be oriented to this reference. If you make local changes to the manipulator, they are stored with each specific point for which those changes were made. Pressing the Reset triad will restore its orientation to the Curve reference’s system.
- You can create Bezier curves or generalized NURBS curves using the Control point curve feature. If the degree n is defined, then creating/selecting n+1 points will result in a single span Bezier. If more than n+1 points are created/selected, then a multi span curve of degree n will result. The Make piecewise Bezier option can be used to force the creation of edges each being a single span Bezier with degree n. Naturally the shape of the curve is identical either way.
- Curves can have their degree elevated (increased) using the Elevate button. In doing so the original shape of the curve is exactly preserved and the distribution of control points will be adjusted to achieve this. While degree Decrease is also provided, the shape can not be exactly maintained. The feature will try to maintain it as far as possible, but as math is taken out of the curve it may become impossible to maintain the original shape. Note: Curve elevation works with both Bezier and general NURBS curves! Try creating an interpolated spline in a sketch. Create a Control point curve feature, and use the sketch edge as the input, and Process this to obtain the control points. Now Elevate the degree, or Decrease the degree.
- Approximate spline edge is a powerful option that allows for complex/dirty input edges to become clean curves (even single span Beziers). To force a Bezier curve, just set the degree to n and the Maximum control points to n+1. Give a large enough Tolerance value… you may need to iterate on this to find a reasonable tolerance that is small enough to preserve the intent of the shape, but also allow the n+1 control points to fit correctly. Note that by giving larger and larger tolerance values you will effectively “fair” the original curve. Of course forcing a Bezier result is not necessary in all cases, therefore you can provide a larger number for Maximum control points and still get a clean result. Another note: if you use the option to Keep start/end derivative, you will unlikely be able to obtain a single span Bezier result. The Process button is designed to be pressed many times, so iterating the inputs until the desired result is obtained is encouraged.
- Shift-C (show curvature/surface analysis) will work as always during the feature creation process. It is interesting to see it dynamically update when you are editing points, or Processing inputs with approximation settings being iterated.
- Q: What’s the difference between setting the Degree, and Elevating the degree of an existing curve? A: Given an existing Control point curve you can:
- Change the degree - by typing in a new value here: This will change the shape of the curve but NOT change the number nor location of the control points. At the extreme low end, if you change a curve to a degree=1 then the result will be a polyline (straight line segments between successive control points). At the other extreme you can assign a maximum degree that is the number of control points - 1. For any changes of degree, the number of spans and therefore number/location of knots will change.
- Elevate the degree - with this button, this will NOT change the shape of the curve, but it will increase the number of control points AND change the location of the control points as necessary to maintain the shape. Note that Decreasing the degree of the curve (using the button) will change the location of control points and TRY to maintain the shape of the curve. While it is mathematically possible to exactly match the curve shape with degree elevation, the reverse is not true, and at some amount of Decrease the shape will change. A typical use case for Elevating the degree is matching the shape of reference geometry (against scan or imported geometry/mesh) with the simplest (lowest degree) curve possible. Once the correct shape is obtained, the curve can be adjusted to meet desired specification: degree 5 or sometimes 7 are commonly used values. There are other reasons and use cases, just getting you started here..
- When edges are processed in order to create points for a Routing curve or Control point curve, all points are created with respect to the curve reference and are NOT associative to the curve itself. Thus if the original edge is modified, the Routing curve will not update parametrically. This is a general (expected/by-design) behavior when edges (or CSV data) are Processed.
- Here is an example (public) doc to try. I have created Part studios that cover most of the features.
Known Limitations/Issues
- Defaults are not finalized, nor are sticky settings. We welcome your feedback and suggestions.
- Value of 1.0 (the default) for the magnitude of the derivative can be too high, causing the curve to disappear (i.e. the feature is in a failed state). Just edit the magnitude and/or direction of the derivative and things will work as intended.
- The triad uses the same color scheme (red = X, green = Y, blue = Z) as the triad in the viewcube, and is displayed when the Show reference coordinate system option is selected. The triad is displayed at a fixed size and is not editable. Thus if you have a very large curve dimension (i.e. multiple meters) then the triad may be hard to see. Conversely, for very small models the triad may be extremely large.
Help and feedback
- All issues and feedback must be here in this post, NOT in separate support tickets. Onshape Support and R&D will monitor and respond here
- Please refer to this document and embedded videos as there is no other documentation at this time
- We welcome and encourage your comments, opinions and findings - in fact the more engagement we have, the sooner we will be able to make any necessary adjustments and get in into the native curve toolset
Re: sketch grid
What about a sketch grid feature?
I've made this custom feature that creates a sketch grid.
Its just a sketch containing a grid of points. But because its a feature, its quick, easy, configurable, and parametric.
The grid is created inside out, so increasing the size of the grid won't break references.
I've made it available for free on fs.place
or you can link this document here
Re: Sketch Grid Custom Feature
One thing worth paying attention to when making features like this is reasonable limits. Right now the COUNT_BOUNDS allow for 100,000 points on each side of the grid, which is way too high and can easily cause performance problems (even if the feature regenerates quickly, having too many entities can cause downstream issues). I would strongly recommend adjusting to a max of 100 points on each side — that should be enough for nearly all use cases and not cause problems.
Re: How do I crop a BOM?
Re: How do I crop a BOM?
Importing a Part Studio part into another Part Studio?
Here is the part link: https://cad.onshape.com/documents/de44882d188fa9e48020f7e1/w/f1025eaabf37ee7fa2c6b3a7/e/9305495a2c174b94b254657d
And here is the studio I would like to bring the part into: https://cad.onshape.com/documents/b6639c39e8b4f23049410673/w/bc5a9dcc16be385e733c5191/e/3c58cde2dca16963c08c6e9e
I would like to be able to maintain all editiable capability of the part if that is possible.
Could you instruct me on wither this is possible or not?
Thank you.
Re: Importing a Part Studio part into another Part Studio?
Thank you. I had forgotten about that feature.
Re: sketch grid
Don, when scaling an imported image, first drop the image into the sketch - then dimension the edge of the bounding box for that image, and multiply that dimension value, by either 0.33 or 3.00 (using your numbers as ratio, or inverse ratio), one scales up, the other scales down. The real key is to work with the edge of the bounding box - you simply dimension that one dashed line, like martin shows above, but use an expression (box dimension/scale factor) and the whole image will scale. Quite accurate, if you do the math right. Once the image is 1:1 then all dimensions pulled from it are honest.
Hope this is clear enough to understand, Good luck.
Re: Forum Software Update
❌ (Space here not recognized for empty paragraph)
❌ Heading 1 (Missing from the options)
✅Heading 2
❌Heading 3
❌Heading 4
❌Heading 5
❌ (Space here not recognized for empty paragraph)
✅ Paste Image From Clipboard
✅ Gif test 1
(❌ Float left from previous image messes up down stream lines which can't be adjusted with empty space paragraphs)
❌Gif Test 2 (Does not display on mobile)
✅ YouTube link as card
❌(Space here not recognized for empty paragraph)
❌(Space here not recognized for empty paragraph)
❌YouTube Embed
❌Plain paste https://cad.onshape.com/documents/f5daef3c0c41cd46ca8a28b6/w/2eade12d75b3867c0630e97b/e/f4ec9c110e6d3bf94eca9c32
❌Rich link Test
(Broken for Onshape documents) (Also forces text after to be on a new line when it does work)
✅Display as text https://cad.onshape.com/documents/f5daef3c0c41cd46ca8a28b6/w/2eade12d75b3867c0630e97b/e/f4ec9c110e6d3bf94eca9c32
Display as card (❌Broken for Onshape documents, so here is this forum post to see what a card looks like)
(Space here not recognized for empty paragraph)
✅Inline code format (Copy paste from Firefox)
FeatureScript 2411;
import(path : "onshape/std/common.fs", version : "2411.0");
annotation { "Feature Type Name" : "Faulty topology finder", "Feature Type Description" : "" }
export const faultyTopologyFinder = defineFeature(function(context is Context, id is Id, definition is map)
precondition
{
(Space here not recognized for empty paragraph)
✅Code block (Copy paste from Firefox)
FeatureScript 2411;
import(path : "onshape/std/common.fs", version : "2411.0"); annotation { "Feature Type Name" : "Faulty topology finder", "Feature Type Description" : "" }
export const faultyTopologyFinder = defineFeature(function(context is Context, id is Id, definition is map)
precondition
{
(Space here not recognized for empty paragraph)
✅Mobile view test: This post shows up great on the phone, gifs and everything!
(Using centered image since float left messes up downstream rows. Though it is nice to have the float left options, we need to be able to not float and place left.)
❌Mobile post test: Unable to update this post on phone, when I press space bar, it somehow brings me to the page footer and erases everything in my post.
❌(Space here not recognized for empty paragraph)