3
$\begingroup$

Say that I have a mesh and a curve. Then I can shrink-wrap the curve so it follows the mesh. Is it possible to flatten the mesh in the perpendicular direction to the curve to make space for a road along the curve.

Original cross-section:

Original cross-section

New cross-section:

New cross-section

The road is supposed to go on the shelf.

Notice that this is a cross-section. The cross-section has a flat segment, but it may still have a gradient into the screen plane. This "Bulldozer" may use surface average, surface min, or surface max, computed along each cross-section the road passes, as reference for where to build the road.

In mathematical terms:

Let the initial elevation be z(x, y), and assume that z is differentiable. Then its gradient is

$$ \nabla z = \frac{\partial z}{\partial x}\hat{\boldsymbol{x}} + \frac{\partial z}{\partial y}\hat{\boldsymbol{y}} $$

Without loss of generality, assume that the road is going in the $x$ direction. With this choice of coordinates, the figures shows the $yz$-plane. After the modifier, I want

$$ \nabla z = \frac{\partial z}{\partial x}\hat{\boldsymbol{x}} $$

because there should be no slope orthogonal to the road. While the original solution fulfils this criterion (in fact, it sets $\nabla z = 0$ along the road), I do want to keep a non-zero $x$-derivative. You wouldn't push away an entire mountain to keep the road flat in all directions, would you?

Here is a picture: https://www.epikdrives.com/grossglockner-high-alpine-road, notice that the road keeps flat in one direction, but still has a non-zero derivative in the other direction. The "bulldozer" is required because any road as a non-zero thickness.

$\endgroup$
5
  • $\begingroup$ hello could you please show some pictures of what you want? $\endgroup$
    – moonboots
    Jun 24, 2022 at 6:11
  • $\begingroup$ is geometry nodes ok as solution? $\endgroup$
    – Chris
    Jun 24, 2022 at 7:36
  • $\begingroup$ @Chris Well, still on Blender 2.9, due to problems with upgrade on Ubuntu 20.04. $\endgroup$
    – user877329
    Jun 24, 2022 at 8:47
  • $\begingroup$ Ok,then my answer makes no sense…but you should improve your question and copy the clarifications from comment into your question. $\endgroup$
    – Chris
    Jun 24, 2022 at 8:49
  • $\begingroup$ @quellenform: Do you know about partial derivatives? $\endgroup$
    – user877329
    Jun 24, 2022 at 18:52

1 Answer 1

6
$\begingroup$

You can try ...

  • Add a Curve - ShrinkWrap modifier to Landscape, Smooth modifier. Apply them.
  • Add a Cube - Array > Fit Curve modifier, Curve Deform modifier

enter image description here

  • For Landscape add Boolean modifier Target > Cube

enter image description here

Notes:

  • Position Cube's origin at bottom face so you can easily scale road (be wider or cut higher)
  • Delete Cube's front/back faces to avoid errors in boolean operation
  • By changing Curve's Tilt you can fix or adjust road angle
  • Moving some Curve's control points inside you can easily create a tunnel :)

enter image description here

$\endgroup$
5
  • $\begingroup$ When I shrink-wrap a beveled curve, it becomes flat. Otherwise, I think it should work. $\endgroup$
    – user877329
    Jun 25, 2022 at 6:01
  • 1
    $\begingroup$ Yes ..sorry for that ... Shrinkwrap was Apply before beveling ... I will edit answer later. $\endgroup$
    – vklidu
    Jun 25, 2022 at 6:07
  • $\begingroup$ What about "Modifier only changed to CV points" $\endgroup$
    – user877329
    Jun 25, 2022 at 6:12
  • $\begingroup$ blender.stackexchange.com/questions/77390/…. Enable that, remove interpolation, and subdivide curve. $\endgroup$
    – user877329
    Jun 25, 2022 at 6:22
  • $\begingroup$ Sorry didn't worked for me, but ... I rewrote answer - Cube with single Array and Curve Deform finally works the best for me ... and stay flexible for road adjustments. Origin moved at bottom face of Cube let me delete two other Array modifiers (used before) and simple scale Cube if needed road wider or cut higher. And relax some dramatic curvatures of road eliminated overlapping cubes array, so Remesh and Decimate (that was heaviest calculation I could delete as well (road is more also natural to real road to keep car's speed. $\endgroup$
    – vklidu
    Jun 25, 2022 at 16:11

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .