I'm trying to dig into the logic of "Convert to mesh from Curve/Surf" functionality in Blender but unable to pinpoint the exact source file where this logic is taking place.

In my walk through the source code, I have so far encountered function BKE_nurb_makeFaces() (L1397 in curve.c) which I think is relevant. But I'm not sure if the 'faces' it is referring to are the mesh faces, wireframe faces, or those formed by the grid of NURBS UV points.

Second place I found to be relevant was BKE_mesh_from_nurbs_displist() (L600-652 in mesh_convert.c). Mesh conversion is probably happening somewhere in those lines, but all function calls there seem to end in just allocations.

I'm looking for the logic where the actual mesh verts (i.e. its x, y and z coords) and faces of a NURBS curve are computed for mesh conversion. I.e. the tessellation logic.

Background: I have text files of NURBS parameters exported from CAD and would like to compute quad mesh verts/faces outside of Blender. I could import Blender-supported NURBS into Blender and create nice quad meshes for them. But my CAD exports contain shapes with Knot distributions not supported by Blender (e.g. pointy NURBS with knot multiplicities in the middle), in which case my only option is computing the verts/faces myself and importing the meshes into Blender.

Could someone knowledgeable about Blender source point me to the logic where x, y, z coordinates of NURBS-converted mesh are computed? Thanks.


Your Answer

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

Browse other questions tagged or ask your own question.