I have a model of a vehicle, I can't show the entire vehicle for confidentiality reasons, but this is an example of one of the panels that makes up the car: Car model and Car model in edit mode.

My end goal is to create a 3D mesh which only contains prominent edges of the model. E.g. This image shows the prominent edges of the model. These edges are extracted from the rendered image of the model using Sobel edge detection.

I've tried extracting a depth map from blender along with the rendered image and finding the corresponding depth for each white pixel in the edge image shown above. However, since the edge image does not detect the true edges with 100% accuracy, the corresponding depth is sometimes taken from an adjacent pixel.

So I think I need to extract the edges directly from the model. Is there some way to automate this process? If not, what would be the best way to manually get the edges? Can I trace over the model or should I just manually select all the edges myself?

Thanks for your help!


Blender includes an edge and line based NPR engine called Freestyle. The settings allow you to use edge and outline detection or specifically mark which edges to use for line work.

sample freestyle result

  • $\begingroup$ I just had a quick look at the documentation for this and it says "FreeStyle rendering results do not have any Z depth information." Do you know if there is another way to get the depth information? $\endgroup$
    – bem
    May 23 '18 at 3:33
  • $\begingroup$ The render result can provide a z-depth pass. You can save it to an image or process it with python if you want. $\endgroup$
    – sambler
    May 23 '18 at 4:07
  • $\begingroup$ Perfect, that should fit right into the pipeline I have now. Thanks a lot for your help! $\endgroup$
    – bem
    May 23 '18 at 5:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.