Modeling Challenge: Offset from an edge

Ken Baker left a suggestion on the Topic Suggestion page. I prefer working on technical problems as opposed to writing about crap like clouds or whatever. So if you send me more suggestions, I”ll post less crap and more good stuff.

Compare the direction of edge perpendicular to projection direction

Here”s the issue. Ken has a 3D surface, and he wants to find the offset of the edges. You can kind of but not really do this with offsetting stuff in a sketch and projecting the sketch, the problem is when a line perpendicular to the surface at the edge is not parallel to the sketch projection direction, you will just get a bad approximation as the result. The picture to the right spells out the problem. The construction line that is perpendicular to the surface at the edge is not parallel to the projection direction, so projecting the rectangle onto the surface will not produce the same result as offsetting the edge of the surface in 3D. Trying to use a projection or a trim is trying to solve a 3D problem with 2D. Because of the symmetry of this simplified example, you might get away with an approximation, but you can do better.

The short answer is that SolidWorks doesn”t have the tool to do this directly. What you need on a conceptual level is a 3D sketch offset. This kind of thing has to be hard to do, because how do you describe the offset direction when the offset direction could be so variable. Anyway, since we don”t have a direct method, let”s work on a workaround.

To remove the simplification of the symmetrical surface, let”s work with my favorite, the dreaded modified egg carton. This was created by lofting 5 spline squiggles, and then drawing a spline-on-surface around the border to trim it so that it wraps around more than 180 degrees, doesn”t have symmetry or straight sides, and basically offers no shortcuts.

I have two possible solutions for this, both feel like workarounds, but are closer than the projected sketch approximation.
#1 – Ruled Surface offset

Because this is a 3D problem you  have to treat it as a 3D problem. What kind of things can we offset? 2D sketches and surfaces. Ok, we can”t use a 2D sketch, so let”s try to do this by offsetting a surface. If we were able to offset a 3D sketch, the offset would work in a direction perpendicular to the edge, along (parallel to) the changing surface. I don”t know how to get where I need to take you using a geometrical proof style of argument, so I”ll just make the leap.

If you create a surface around the edge of the surface where the new surface is always perpendicular to the existing surface at the edge, you can then offset the perpendicular surface, and the intersection of the offset surface with the surface will give you the offset edge. It turns out that the Ruled surface can make a surface that is always perpendicular to a surface along a set of edges. I told you ruled surfaces were great construction geometry tools. Follow these steps:
1. Make a Ruled Surface around the edge of the surface – use the Normal To Surface option, and make the distance something that will work. If you have tight curvature on the original surface, the ruled surface has to be smaller.

2. Offset the new Ruled surface by the amount you want to offset the 3D sketch. Again, tight curvature will make this more likely to fail. Offsets follow rules. The original surface is blue, the Ruled surface is black, and the offset ruled surface is yellow.

3. Now offset the original surface by an amount less than the distance of the ruled surface. This new surface is red.

4. Trim the red surface with the yellow surface. Then hide the yellow and black surfaces.

5. Make a boundary surface from the loop around the original surface to the loop around the offset and trimmed red surface. Getting this to work will involve using connectors to keep the boundary surface straight. Connectors is a blog post topic all its own. The secret here is to make the connectors as short as possible. Go straight from one surface to the closest point on the edge of the other surface.

#2 Face Curves U-V
The second way may be less risky, but it will only be usable in certain situations. You can”t use this method on the part I just showed, but you could use it on the original part Ken sent. I”ll use it on the part I created, but without the spline-on-surface trim. Here”s why.
This method uses the U-V curves of a face. In order to for an offset to work, the surface must be the original 4-sided surface – it must be untrimmed. If you look at the picture to the left, notice that the blue and pink lines (created by the Face Curves feature) do not run parallel to the part edges.

If you look at the image to the right, the lines are parallel to the edges. The right is the underlying untrimmed version of what”s on the left. The U-V lines can be used as offsets because if you think of the entire length or width of the face as a distance of 1, you can offset an edge by a percentage, which you should be able to figure out as an equivalent distance. So let”s pull back 10% from each edge. Here”s how to do it:
1: Use the Face Curves feature while in a 3D sketch. You can do this outside of a 3D sketch, but it will be lots more work. Use the Position option and set the blue and pink positions to 10%. Click the green check to accept the curves in the 3D sketch.

2: Start the command again, but this time use 90% for both blue and pink. Click the green check again to accept the curves.

3: Next (still in the 3D sketch) use the Trim Sketch command to trim off the corners so you are left with a 3D rectangle on the surface where all of the sides of the rectangle are offset from the edges. Be careful, because Trim is buggy on 3D sketches. It will often clip off the part you want to keep. You may have to rotate the point of view to get it to select properly.

4. You can start the Surface Trim feature while still in the 3D sketch. Make sure the type is set to Intersection, and then discard the outside of the surface.

5. Loft or boundary the outer edges of the surfaces to get the result.

Neither method is bomb proof, and there is room for a lot of improvement. Would anyone else like to share a possible solution to this?

Download files for the parts I made here.

28 Replies to “Modeling Challenge: Offset from an edge”

  1. Where is the price list for NX stuff? Maybe we can publish pricing right on this blog.

    The pricing of CAD software is amazing. There are no price lists. Everything is a special quotation for something with unknowable functionality. Catia is king of inscrutable pricing.

    The CAD may appear to do the job. Sometimes the geometry is not accurate. Take a close look at shells, lofts, ruled surfaces, projected curves, and sweeps.

  2. NX can do this very simply.
    1. Insert > Curve from Curves > Offset in Face. This creates a continuous curve lying on the face.
    2. Divide Face with the resulting curve.
    3. Insert > Offset/scale > Offset Face. Offset the inner portion to get the sandwich thickness.
    4. Insert > Mesh Surface > Through Curves. This gets the “ribbon” of the sandwich around the edges.
    5. (IF you want to) Sew surfaces to create a solid.

    1. Yeah, listen to someone named “anon” saying “NX can do this very simply”. I got pricing today for NX with advanced surfacing. $25,000. No joke. NX with basic surfacing is $9,000. I can do a lot of workarounds for $21,000.

  3. Oh, also:

    1. Create a ruled surface perpendicular to the existing edge.

    2. Fillet this intersection with a radius equal to the diameter of your trim.

    3. Delete fillet.

    This obviously only works if the fillet works, but they are both mostly constrained by the same radius of curvature, so it shouldn’t really be an issue.

  4. Here’s another approach.
    already mentioned above….but part included for reference.
    [file] Edge.SLDPRT[/file]

  5. @Mark Biasotti
    Wow, thanks for that. That’s an involved process. Thanks for the sample part too.

    Oh, ok, I get it. At first I didn’t see what it was doing, but now I see. It approximates the curved length with the arc, and the arc remains the same length, but different radius as the surface curvature changes, so the tube is a variable diameter.

    A much better but very tedious approximation. Very nicely done. It took a while to appreciate exactly what it is doing. The need for the technique is itself a workaround, and the arc length approximation is a second level of workaround, but given the tools that exist, this is very nice. Very nice use of 3D sketches too, by the way.

    So you’ll fix the fixed length spline?

    Mark, make sure to thank Nick for me. I appreciate the effort that went into this.

  6. (I’m posting this for Nick Birkett Smith, one of our engineers in our UK office – Mark)

    I have another method which gives quite a good approximation where there is a change of curvature near the edge being offset. Please see attached part (SW2011).

    Method is:
    1) Create a planar construction surface normal to edge (Surface-Plane1)
    2) Pattern this surface along the edge (CrvPattern1) – more instances = better accuracy = more work
    3) Extend original surface if required, so it intersects all patterned construction surfaces
    4) In a 3DSketch (TrimmingGuide3DSketch):
    a. Create Intersection Curve where each construction surface intersects the target surface
    b. Make arcs at each of these intersection curves, coincident at three points to intersection curves
    c. Use the arc dimension to set each arc at a given dimension – this gives a close approximation to a fixed length spline (something we cannot do)
    5) Use the 3DSketch in step 4 to drive another 3DSketch of circular sections, which are used in a surface loft feature (Surface-Loft2) to trim the target surface

  7. @Mark Biasotti
    Thanks for stopping by. Yeah, this would be a tough one, but valuable if you folks could solve it. Maybe if you take say 100 points along the edges of the existing surface and plot where each point is on the untrimmed u-v mesh, then move those points in one direction by a certain percentage or arclength if you could manage that, then approximate a spline based on the new set of points. I’m sure accuracy would be an issue with that, and maybe if it had enough points to be accurate, rebuild speed would be a problem.

    Maybe you could make a temporary optimized fill surface based on the existing border, then figure the u-v offsets from the fill surface. But that would only work for 4 sided shapes.

  8. Matt, I don’t use SW but your observations are incisive and your challenges are fun. This one is interesting. It’s easier from a geometry point of view than a blend. A blend would have to have tangency with two faces, and the edges faces could have any number of parameters that a blend would have to observe, and which would affect the offset from the boundary. This challenge calls for the inset to respect the edge that an analogous spherical router bit with its centre traversing the boundary of the surface would subtract. It would profile a more erratic edge than a pipe along the boundary, if the boundary’s not too good. The offset would then be the chord length, the other possibility would be if the offset was length-of-curve on the surface, normal to the edge.

  9. I encounter this problem while working with aircraft canopy shapes. The canopy frame must be at a particular angle relative to the skin. I have been using a sweep to achieve this. The path is the window outline, the profile is the frame section, and a nearby guide curve determines the oreintation. It is not exact in angle, as the local curvature is rather the average between the window edge and the guide curve. It is predicatble and controllable.

  10. Matt,

    Nice Post; the use of face curves with the position option is clever and something I didn’t think of. Like you, I usually make use of Rule surfaces. I do think we need an offset curve (sketch) feature and you’re right, direction of offset is the killer – how do you make that easy to use? My thought is a very well designed Triad in which you can easily reposition and change direction to specify the offset. Otherwise, perhaps just a set of options for direction, like Rule surface does essentially.

  11. I would like to post my tip related to this topic. One of my solutions in similar case is:
    1. add thickness from the surface source
    2. move face (outside or inside)
    3. offset surface – that is a fully parametric (offset distance should be equal to thickness)
    4. remove unnecessary solid body.

    See also example: (sorry, comment only in Polish )

  12. Well that’s about the most beautiful thing that I’ve ever seen. Thank you, Matt. Perpendicular ruled surface offsets are so simple they’re positively brilliant.

    I work for a company that uses a number of different CAD systems – foremost being CATIA and SolidWorks. The composite design engineers tend to favor CATIA, while the mechanical guys tend to favor SW. I think that the perception that SW is a poor surfacer has kept lots of people here from adopting it for composite design. Tricks like this really deserve mention – because they make common daily design tasks more accurate and usable on the shop floor. In the past I would get to a certain point on a part in SW, finish up everything else, export to iges or step, load into CATIA, and make my core templates there. No more!

  13. @Jeff Mowry

    Hi Jeff. I knew that someone would have to have used the method before, since it allows really a lot of control. Back ten using two circles of different diameters at the opposing ends of an edge, was the option I had to make an explicit variable fillet with known measured values. I think I used this method mostly in MasterCAM, since Intergraph I/EMS although being older, it did have very good wireframe and surface modelling abilities. And some crude form of parametric editing sometimes. But in Mastercam, that’s the way it had to be done, for things like variable fillets or chamfers. I just was not hopping that in SolidWorks some workarounds had to be made, since I was imagining that they had implemented “curve on surface offsets” a long time ago.

    The lacking “curve on surface offsets” is not so embarrasing for SolidWorks, since it’s younger than Pro/E, and Pro/E still does not have an “Untrim” surface command. The way that I used to “Untrim” surfaces, for example, to create “patches” to close holes or to create parting surfaces for mould toolings, was to make a copy of a part surface (The software does allow to remove interior trimming loops when copying a surface, but strangly does not allow to remove the exterior trimimng curves when copying surfaces). With that surface copy, to remove the outer boundary, we would have to extend it, which is very difficult if the countour is very intricate, or has tight radius, as you have said, that may cause crinkling. So, if the surface has to be extended a little bit, it works… if not, the surface has to be trimmed by a sketch or by a plane, to make a straigth trimming edge on the surface copy, and then use the straight edge to extend the surface boundary. Needless to say, lots and lots of work.

    Some of my former colleagues had discovered another method to “untrim” surfaces in Pro/E, which actually worked faster, but was an uggly one, from my point of view, and I rarely used it. There was a command to create “freeform” surfaces from existing geometry. It allowed to choose an existing model surface, would ask how many “points” on a grid we would want, to manipulate the freeform surface… and would make a copy of any surface, in an untrimmed fashion. If the surface was not “manipulated” with the control grid, it would be identical to the “untrimmed” or original base surface. It was faster than the method I used, but had the problem that the “freeform” surfaces created, could accidently be manipulated at any time, and they were created always as NURBS, even if the original surface was planar, or cylindrical, and we wanted to keep it that way (to be able to measure angles, diameters, etc). And it was an heavy method, that required surface type conversion. It would be a lot simpler to simply have an “Untrim Surface” command, or at least allow the “Copy Surface” command to untrim also the surface outer boundary, maintaining the surface topology.

  14. I’m struggling conceptually to see what is happening with the egg carton example Matt. What I think you are attempting is something I have to do on every job at some point, but perhaps the true test should be one where you need to offset/extend to a specific angle along the edge. What I mean is, if you consider a complex shut off on a mould tool, you may need to run a surface along that edge at a specific angle (or offset when looking at it from a certain projection).

    I come across this frequently when doing medical work on things like this:

    The really hard part is modelling to a specific tooling requirement – but – this actually can make things easier. For example in your egg carton example I wouldn’t bother with that type of offset if I was trying to draw the part off a tool. I’d probably just untrim of extend the edges of the surface, offset it, then create a 2D sketch from the original projected edges, offset them, use that to trim the offset surface, then run a sweep or boundary or fill (or whatever the geometry suits) between the original and offset surface edge. Probably not that clear 🙂

    Extrude from surface does actually work well too!

  15. Steve Joe beat me in answering this question with his circular/tubular surfaces along the edge of the surface idea. In fact, this is something I’ve used in the past on production projects, though most of the time it works well because I need the offset only along one edge of a surface (for whatever reason) instead of as a percentage offset from all edges of a surface.

    While this is a versatile means of “forcing” the software to deliver the results you need, it can have drawbacks. It has the same limitations of tight-radius crinkling, for instance—so your swept circle can self-intersect and fail if your surface is too tightly crinkled or your circle radius is too large. Hacks and approximations abound at that point.

    Also, because of non-uniform geometry, you may find you need to extend the sweep path a bit with tangent geometry to make sure you’re getting your swept circle completely through your surface (instead of having it terminate a bit short). This is done within a 3D sketch, and conversion/manipulation of curves is the only semi-reliable use I’ve found for the 3D sketch tool—but in a case like this it can be essential.

    Great challenge/post, and I’m surprised to see someone (like Steve Joe) coming up with the unlikely solution I’ve had to use in the past.

  16. Sorry, just adding one more thing.

    If I understood the problem correctly, the “Thicken” surface method, and offseting the exterior surfaces, seem to be the better way to do it. Faster and precise also. I just mentioned the old method, because back then, there were no “thicken” surface methods, since those CAD programs were essentialy surface modelers, and not solid modelers. The worst part at the time, was the “not parametric” nature of all those commands, and the tedious “untrim” surfaces and redo the projections / intersections and trims, whenever something had to be changed in terms of dimensions. But I do still miss I/EMS, altough not much MasterCAM at all.

  17. Hi Matt.

    I’m no SolidWorks user, but I appreciate your blog, and had used CAD tools since the Intergraph I/EMS one, which was mostly a wireframe and surface modeler. I’ve used MasterCAM long, long time ago, when it hadn’t any solid base geometry construction methods, so this kind of challenge was something that would have to be dealt with on a daily base. Then moved to Pro/E since version 17 till Wildfire 3. All software have missing features, and in most cases, time and experience will show some of the workarounds in geometry construction. Even Pro/E didn’t have an explicit Surface Untrim command. But there were some workarounds that could be used even tough some were not “pretty” and others were unecesserily time consuming.

    Some features, tough, when missing, make it impossible to do something, and there are really no workarounds possible. I can cite the example of TopSolid 7, which I was evaluating, as of version 7.4, which lacks a 3D curve silhouette command, projected on the contouring surfaces. Until it get implemented, there’s no way to use this good looking CAD program to do Mould Tooling modeling, of the mould parting surfaces. Which is a pitty.

    Having said that, I’m not so sure that I understood the challenge that you presented. But I’ll add one detail to one of your methods, and suggest another way to do what I think you were after.

    In the case of the UV curves method (which Pro/E couldn’t create, but that I used a lot in Intergraph I/EMS and Mastercam surface modeling, specially to create rail lines for fillets and chamnfer creation)… If what you wanted to do, was an offset of a known distance, say 10mm, that method does not work, since it’s only a percentage of edge UV length. So, if there’s a command in SolidWorks to measure the length of a curve or an edge (which I suppose it’s possible), then I gess you can make a formula linking the U and V percentage value, to the measured length of one of the edges. The problem is that this method would not work if the opposing sides of the surface had different measured lengths. This would produce a variable offset, not a constant one as I suppose that’s part of the challenge.

    The method I would propose, and that I used to use sometimes in I/EMS and Mastercam, is to use each of the 4 sides of the original surface, as rails to make a sweep, with a circle as a sketch, with the radius equal to the distance of the offsets that we want to create. With those 4 “tube” surfaces on each side of the original surface, I would then make a surface-surface intersection curve, between the original surface, and each of the 4 “tube” surfaces centered at the edges of the original surface. Then I would mutually trim the 4 curves to each other and would use them to trim the original surface, or copies of it, or whatever was needed. Truth must be told, tough, that inspite this method being more precise, it’s really also an approximation if the original surface had lots of curvature near the edges. But if it was mostly linear, then the “circle” method would give the most precise offset curves from the edges.

    But sure it would be much better to have a direct “offset” surface edge command, that can offset “parallel” to the surface, or perpendicular from it, as is possible in Pro/E, or better yet, a “shrink” surface, or as also the case with Pro/E “Extend” surface, where if the distance offset value is negative, it will shrink the original surface, instead of extending it.

  18. @matt
    I don’t know. I know enough about surfacing to be dangerous. I just thought it would be a good excercise for you 🙂 Playing around with it a while though, I think that the same process would need to be followed, but I tried using Thicken to generate the surface around the perimeter to offset in.

  19. @CharlesCulp
    Very cool, double reverse extend. Love that. That actually would follow the curvature better than the offset ruled. The offset ruled does not account for changes in curvature of the face.

    When I got to talk to the SW surfacing developers at NESWUC recently, I suggested Mikes idea to them. Never know. Somebody probably suggested that extrude-from-edges-not-a-sketch thing too.

  20. Mike Wilson suggested a “reverse extend” in Sept 2008.

    To note, you can still use the “extend” tool to get the same effect, it just requires a few extra steps. You just need to extend the existing surface out, then “hollow” and trim it back to the existing size. Then you can either extend, or hopefully “untrim” inwards the defined distance.

    To make the last model above, that would actually be my first thought. Do a surface offset, then do a “double reverse extend” to trim it back. I do like the ruled surface + offset better though, I might try that way instead.

  21. I have had success using a method similar to the ruled surface method… I’m usually operating in a hybrid situation where I spend most of my time with solids, but use surfacing tools as needed. If I needed to accomplish this, I would most likely thicken the surface to some arbitrary amount, then use the Move Face tool to offset the edges. If I needed to go back to surfacing, I would then Use the new face geometry to create the new surface with extended boundaries.

    I like your approach of using ruled surfaces to accomplish the same thing and will certainly be putting it to use.

    Thanks Matt!

Leave a Reply

%d bloggers like this: