Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape, CAD, maker project and design.
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.
Slope between 2 Points
famadorian
Member Posts: 92 ✭✭
I have a spline between 2 points which are 30m apart. Point 1 is also 9m below point 2.
This is from a map.
I want a road between these two points, so the gradient has to be smooth between the two points.
Is there some way to make the curve be descending smoothly from point to point?
After I have the curve, I can just create an offset to get the road.
0
Best Answers

NeilCooke Posts: 1,798Try Projected Curve using the spline you created from the map for the first sketch and a straight line (drawn on a plane parallel to the spline plane) for the second sketch.Neil Cooke, Director of Technical Marketing, Onshape Inc.1
Answers
Secondly, I want any point on the curve to have the same gradient.
You may want to look at this though
https://www.onshape.com/cadblog/everythingyoueverwantedtoknowaboutonshapesplinespart1of2
I have the spline in the image I provided. This was drawn from a map (like google maps). Between the two points is a height difference of 9m and the descent from the first point to the second point is smooth. With that, I mean that there are no sudden height differences. It just goes from 9 to 0m in a smooth manner. Mathematically, the derivative at each point in the curve would be equal.
Projected curve did not regenerate properly: Error regenerating
Is there any way to get a more thorough error message that can help me troubleshoot this?
https://cad.onshape.com/documents/132f478d1367918a9272a4b2/w/face29ccc91bf0b664d259ca/e/3b29dd36c9b031b4ea742fc8
See https://forum.onshape.com/discussion/9239/opbooleanonsurfacebodies
It should work if you extend the ends of the line for the slope
When Onshape does a project curves feature, it first extrudes the two sketches so that the surfaces intersect. They then do a boolean intersection, which fails if there should be two curves.
Why would it generate 2 splines?
@lougallo?
Also, it's equally the same if they intersect or not, because regeneration does not seem to depend on that, as in all cases, they intersect, but regeneration fails randomly.
I'm just looking for a way to understand why it won't regenerate and if there are a log file which can explain better why it's not regenerating. I must be lacking some very basic fundamental knowledge here if this is so obvious to you.
I'd offer up the idea to use surfaces to convey your intent. This is way easier for the next guy to gain a better understanding of what's going on.
A little more interesting:
I typically make these surfaces transparent:
The highlighted 3D curve above, this is the design pattern for how I'd control it. With our 2D monitors, it's too difficult to control 3D curves. You can't see 3D on a 2D monitor. I still fall back to the projection of 2 x 2D sketches = 3D curve. But to help understand these better, I'll extrude a surface for the visual.
Possibly the fastest gradient for a mountain bike to get down a canyon path:
For fun, I'm mapping a bridging curve to the 1st 3D curve created by the projection. It's a really good approximation and it's freak'n easy.
With the bridging curve, what's not well documented, is the "First side" definition can have 2 parameters.
Bridge curve inputs:
1. the curve
2. which vertex on the curve
@famadorian don't give up curves & surfacing.
Map a 3D curve to the serpentine down hill curve using a 3D fit spline:
I had to turn on 2nd order curve mapping ("Match curvature at start") and help effect the 3D fit spline to match the downhill gradient. "Match curvature at start" looks at the rate of curvature change and adds it to control the 3D fit spline. Remember 1st order is the direction which you get when you click on "Start direction".
To get this to map more closely, you'd have to add another node point. I'm not a fan of 3 noded splines.
Remember that a 2 noded spline can only make an "S" shape with 2 inflection points.
That's because it's a basic spline which is 3rd order. It's a cubic. a + bx + cx^2 +dx^3. dx^3 is the cubic creating the "S". It also needs the y & z part of the matrix.
So awhile back I wrote this curve fitting algorithm that maps a curve on top of another curve:
Above I'm using 8 nodes to insure that my new curve doesn't deviate more than 1mm from the original curve. Personally I don't like using a lot of nodes when generating curves. It's a lot of math that perpetuates itself through a design. If you extrude a surface from a high noded curve, then that surface is all knotted up. If you cut a solid with that surface, then your solid is all knotted up. It never goes away.
So below I show your original curve.
and:
1. a bridge curve
2. a fit spline
3. my fit spline
4. a 2 noded spline