Inkscape.org
Beginners' Questions Looking for a clean way of implementing a smooth transition between paths with filling+contour
  1. #1
    elidiot elidiot @elidiot

    Hi, I'm making a map of a place having upper and lower floors. During the transition between upper and lower floor, I want to do a color gradient (sometimes the transition is quite long).

    I want it to look like the picture, but without the two contour lines crossing the way. Optimally, I would like to do it without having separate paths for contour and fillings, so that I can easily modify the map when I want without having to modify both separately. I don't know how I can proceed as one path can only have one color, and one contour style.

    I hope that I explained the situation clearly !

    Thanks for your help.

    Capture D’Écran Du 2024 03 21 04 11 21
  2. #2
    Paddy_CAD Paddy_CAD @Paddy_CAD

    Perhaps something like this.

  3. #3
    elidiot elidiot @elidiot

    Hi, thanks for your answer. I might have not understood your point fully. Here are two things that seem to be a problem to me:

    - if I take the union of paths, this creates a color gradient on the whole path itself, which modifies the color of the other parts of the map. Because this is just a local picture and map mapa is big, I cannot use any solution which affects the map globally.

    - duplicating the path to extract a contour path is exactly what I said I did not want isn't it ? I guess I just didn't completely got what you proposed.

    Thanks!

  4. #4
    Paddy_CAD Paddy_CAD @Paddy_CAD

    Here's an unstable solution. It doesn't render correctly here in the forum, but it looks good in Inkscape. I can't think of an easy way to do this. It's possible, but probably not worth the effort.

  5. #5
    elidiot elidiot @elidiot

    Thank you for your answer. In the meantime, I found a solution which is not pretty but satisfies all my requirements.

    Here it is:

    - set the filling and contour of each path to undefined

    - for all piece of path, create two clones, one called Contour and one called Filling

    - modify the clones' styles, which is possible because the base models have undefined style: the contour clones have no filling together with a preferred contour style, and the filling clones have no contour and a preferred filling style.

    - make sure that all "filling clones" are on top of their respective "contour clone"

     

    Now, modifiying the model paths also modifies the clones, and because fillings are on top of contours, separating contour lines have filling over them.

    This solution sounds outrageous to me, but still is the best that I can think of.

  6. #6
    Paddy_CAD Paddy_CAD @Paddy_CAD

    Well done. Your workflow is simpler than mine. I suggest opening [Object > Layers and Objects...] and locking the clones. This makes it easier to select the parent shapes below them.

  7. #7
    Tyler Durden Tyler Durden @TylerDurden

    I'm missing something... Why all the clone use?  Gradient stops can be added to narrow the transition region.

     

     

    Modifying a gradient does not need to change other gradients in the document. Preferences>Tools>Gradient Tool> Prevent sharing of gradients.

  8. #8
    Paddy_CAD Paddy_CAD @Paddy_CAD
    *

    I wanted to avoid the situation on the right, though it's not a problem in my earlier examples.

  9. #9
    Tyler Durden Tyler Durden @TylerDurden

    Ah, ok... that makes sense to me now.

  10. #10
    elidiot elidiot @elidiot

    Thanks for the good additional trick of locking the clones @Paddy_CAD.

    And yes @TylerDurden this is the reason why I used so many clones, the issue is a very local picture and because the path if big and complicated, I need a solution that only affects the path locally. If you can think about another solution for the problem, I'll be very happy to hear about it though :)

Inkscape Inkscape.org Inkscape Forum Beginners' Questions Looking for a clean way of implementing a smooth transition between paths with filling+contour