GSoC 2025 Draft Proposal : Surface Data-block

Synopsis

Blender has had basic NURBS features for years with no upgrade and very little usability. As Blender attracts hard surface modelers and designers, the demand for improving precision surfacing has always existed.

As the following task presents #100127, upgrading the surface system means upgrading the core data structure since it is limited by past choices. Currently, NURBS surfaces share its data structure with curves, and not only have they both diverged, but the curves in question are getting replaced by a new system.

The making of a new data-block is also, as #100127 mentions, an opportunity to make surfaces compatible with GeometryNodes. Having procedural NURBS modelling would be a potential game changer for the modeling capabilities of Blender.

Since I have been coding a Blender add-on bringing NURBS modeling to Blender and I am currently learning C++, I believe that I am in the best position for undertaking such task.

Benefits

Since the project should not make any user-side changes, the benefits are indirect and long term.

For Designers and modelers

Currently, no open-source solution exists for creative-oriented surfacing. However, this doesn’t prevent designers and modelers from using Blender wherever high precision isn’t required (early concepts, video-game models…). Native NURBS surfaces would also eventually mean better exchanges with the CAD world. This would be appreciated for product rendering.

For Architects

Again, no open-source alternative for procedural NURBS modeling (as Rhino Grasshopper). GeometryNodes seems to be the perfect platform to change that.

For Scientists

NURBS can serve for point-cloud fitting, mesh interpolation, or simply representing continuous surfaces. This would certainly be appreciated by the scientific community, who already use blender for data visualization.

For Beginners

In the long term, investment in NURBS will spare new users the confusion and disappointment of knowing that NURBS exists in Blender, but are not usable.

For Future Proofing

It is another step for legacy curves deprecation.

Deliverables

  • A new surface data-block

  • The removal of legacy-curves surface features

  • One or more experimental build

  • Feature parity with existing system

Project Details

The first project goal is to separate surfaces from legacy curves. It can be done by careful duplications and cleanups. Doing it first has the advantage of better understanding of the existing system and everywhere it connects.

Next the goal is to create the upgraded surface data-block. From the requirements I collected, I made the following concept.

I. Architecture

I assembled the following class diagram :

Class diagram

Since implementing everything exceeds GSoC time scope, the goal is to implement only the branch going from the NURBS level to the object level. No trim contour, no dependency tree, no surface edges or 3D curves.

This class diagram has to be discussed carefully but here are some reasons for such structure :

  1. Object level : Each surface object contains one surface data-block to stay consistent with current blender objects.

  2. GeometrySet level : The surface data-block is part of a GeometrySet to be accessible through GeometryNodes.

  3. Surface Data-Block level : The data-block contains mainly a list of surfaces. All the other data is added for boundary representation (explained later).

  4. Individual Surface : Surfaces needs at least an ID, a boolean for normal orientation, a material and the ability to store generic attributes. They could also have a transform matrix to facilitate transform.

  5. Sub-types : Each surface has a sub-type with attributes defining its geometric representation. NURBS is the priority sub-type, as they can represent any type of surface. In practice, however, surfaces such as plane surfaces or cylinders are unpractical and inefficient to edit as NURBS. It seems unlikely that we could create a good modeler without sub-types. So even if we keep only the NURBS sub-type for a time, planning for sub-types makes sense.

  6. Dependency tree : This is the main component to achieve boundary representation. It stores relations between surfaces, curves and points in a tree. The tree is built chronologically along the modeling process to keep track of dependencies. This is essential to connect entities with non destructive link without dependency loops.

  7. Trim contour : All surface sub-types are define geometry parameterized in U and V and should be trimmed by one or more boundary loop. Each boundary loop is made of 2D curve segments. Each surface have one outer loop and several inner loops which cannot intersect or be nested (to prevent defining several surfaces with one. Without contour, the surface is trimmed by its “natural boundary” (the control grid zone for NURBS). Trimmed surfaces need a meshing method which can be challenging to make reliable and clean.

  8. Edges, 3D curves and points : Boundary representation is based on shared topological features (faces shares edges, edges shares points). It may seem strange to add those in a “surface” object when Blender already has overlapping concepts for curves and points, but they are required for any non-destructive editing.

  9. It shares similarity with OpenCascade structure an established existing geometric kernel for CAD (Surface here is what OpenCascade calls face and sub-types here is what it calls surface, the best naming for Blender should be discussed).

II. Data Structure

Derived from the architecture, here is how data may be structured :

Whenever the data has the same length for every surface, it can be represented as a generic attribute (in one chunk). If the length defers, here the geometric data and the trim contour data, it is stored separately. The parent data simply stores the address for it.

This structured is registered as part of Blender DNA and BKE, similar to other data type.

III. Using and evaluating the new surface data

Once the new block is declared, it needs to wire correctly with all systems already using NURBS surfaces. Among them : edit mode, operators, modifiers, exporters, rendering, undo… Older files should also be converted seamlessly or at least without crashing. Exact backward-compatibility and feature parity may not be strictly necessary since users of the old system are very rare. However without explicit decision, it is assumed as needed.

Some systems will probably only require some simple checks while others will require some rewrite. One of the main unknown is on surface evaluation (going from geometric data to discrete surface point or mesh). Considering its age, the current NURBS evaluation may use some old standards or hacks which would make sens to cleanup at this stage.

If any time is left, I would look at how to make the new surfaces compatible with GeometryNodes as well as detail the design for trim contours.

Project Schedule

This is a large-sized project (350 hours) with 35h per week for 10 weeks (3 weeks unavailable on a 13 weeks span).

  • Week 1

    • Investigate on current NURBS code
    • Separate current surfaces from curve legacy
    • Discuss the proposed plan
  • Week 2

    • Not available
  • Week 3-5

    • Make sure to have all the main requirements
    • Prototype the new surface data-block
  • Week 6-8

    • Implement, adapt and check dependent systems
    • Fine-tune the data-block
  • Week 9

    • Publish a build
    • Fixes
  • Week 10-11

    • Not available
  • Week 12

    • Cleanup, fixes
    • Ensure feature parity
    • Ask for review, pull request
      If remaining time :
    • Dig on GeometryNodes integration
    • Detail the plan for trim contours representation
  • Week 13

    • Free for probable delay and unknowns

Bio

I am a French 25 year old recently graduated engineer in mechanics-mechatronics. I am passionate about industrial design, drawing, image creation and animation. Currently working as a part time freelance designer and part time add-on developer.

I started learning Blender in 2014 for some naively ambitious animation projects with my friends, and I didn’t left it since. The Blender keyboard shortcut workflow began to feel so fluid and powerful, that when I later encountered CAD software in my internships, it felt like an other era. I really feared having to work daily with those. As I was working on the early development of some product, I could introduce Blender as a way to iterate on the product architecture in real time, while some engineers on my shoulders made suggestions. This was highly appreciated. The main limitation being of course possibilities of exchange with the mechanical world.

As a response, I started one and a half year ago to develop an open-source add-on called SurfacePsycho. It already has been successful in offering some actual NURBS modeling, with surface trimming and CAD file I/O. All of this in record time, considering my absence of prior knowledge of any of NURBS math! This was really made possible thanks to GeometryNodes instant feedback (and my determination '°u°).

With this project, I learned about the technical challenges associated with NURBS and I caught the attention of many professional designers. However, it slowly reaches its limitations : performances, mathematical stability, lack of external libraries… GeometryNodes was not design to make full software after all. So as the next logical step, I am gradually switching to C++. GSoC seems to be the perfect opportunity to make the most of this knowledge and benefit the community.

38 Likes

Hi, here is my project draft, I would greatly appreciate any feedback. I know the project is ambitious for my level but I am extremely motivated :smiley:

14 Likes

hi, I find this project extremely exciting as it contains what I’d say is my most wanted missing feature in blender.

I am an architect and I share a similar experience as you do regarding CAD. Starting with blender and then jumping to comertial CAD software made me realize how good blender actually is for my type of work. The CAD software I now use is rhino+grasshopper and microstation for drafting. Grasshopper used to be my main medium for generating parametric models, but now acts more like an aid as I find geometry nodes more comfortable to work with. The reason I cannot fully commit to blender for my modeling tasks is because the state of curve and surfaces is very limiting.

Sadly I cannot provide any other meaningful help but encouragement, testing and ideas as I know next to nothing about programing. I will be keeping a close eye on your development. Thanks a lot.

7 Likes

GeometrySet is only runtime data type used internally. This is not best idea to mixup geometry nodes and edit mode support for new geometry type in single project.

  1. For edit mode you’ll have to add:
    1.1. DNA structure definition for everything (parallelly to BKE) to have a save and undo worked.
    1.2. RNA to have an api interface to python.
    1.3. Implement all operators to edit new geometry type (both in C++ and probably something in python)
    1.4. Add support for undo system (how to store all this classess from your graph).
    1.5. Edit mode also probably have to have an overlay and data block UI in properties panel.

  2. And to have a geometry nodes integration:
    2.1. GeometryComponent, SurfaceFieldContext, SurfaceFieldInput, attribute provider.
    2.2. Spreadsheet tab for surface parts.
    2.3. Generic support in Separate Components node.
    2.4. Joint Geometry node support. This is something for at least 1 week.
    2.5. Is there a new domains for a surface component? Only points and… curves? There is no faces or edges? Or segments of the curve between corners?

Also, one of the most complicated parts of the project, as i think, is the boolean operations (not sure is there any mean to support such non-trivial data block as a surface with some polygon on it if you can not implicitly edit it by boolean operations with other surfaces). And i did not noticed this in the task.
In case you plan to separate surface (set of points and way how to construct surface between them?) and polygon region on it in UV coordinates this does mean you also plan to support all 4 (currently 4) curve types on such surface? And boolean between them.

One of the main reason why this is such important to have a boolean out of the box for this project is because you’ll probably need to be able to render this object. And not sure implicit render (not as a mesh but as some complicated shader) will be accepted (there is at least 3 built-in render enjins…).
For example, Greapencil3 had such issue while some time proper support for its boolean right not base on delaney triangulation at render time.

5 Likes

Hi, thank you very much for this feedback ! It seems indeed reasonable to remove the GeometryNodes part. I probably underestimate the work on DNA an RNA.

My plan was to not change the UI for the moment, except in case of strict necessity.

I think there is a confusion here, I called “surface” what you call “face” (In OpenCascade they use “face” for the topological component, and “surface” for the geometric definition, here I used surface to avoid confusion with poly faces).
My idea for the points and curves was to not implement them in the GSoC project. Each surface having only it’s control grid like the current NURBS system. It may be necessary to dig deeper in the design to make sure domains on points and curves are possible to add later though.

In the last part I am confused about the meaning of boolean operations in this context. It can means very different things.

And for rendering I was planning to output an explicit mesh. I don’t think many software are computing NURBS on the GPU anyway.

6 Likes

Vred is most likely ahead in direct NURBS rendering, but they have not been able to render it on GPU. Its not a good idea to follow on this IMO.

Could be later worked around with Geometry nodes and camera input node for camera-dependent tesselation. But thats offtopic now.

1 Like

I guess you used boolean to refer to surface-surface intersection followed by trimming right ? Assuming that, this is out of scope for the project since it is part of “modeling algorithms” and not “modeling data” if I follow OpenCascade naming.

I am building a more complete plan separately (out of scope of GSoC), and if you are interested by the details for such intersections, here is the idea : Intersections are computed by a solver which sample a chain of intersection points. Those points have 3 defined positions :

  • one 3D
  • one UV for surface 1
  • one UV for surface 2

The 3D points are used to generate the intersection curve through global interpolation. The resulting curve is then considered to be one of the 3D edge of both surfaces. And their dependency is registered in the tree.
For each surface, the UV intersection points are then also interpolated to form a UV curve used to boolean the existing trim contour (which region to keep is decided by a raycast at operator validation which can sample a UV point in the region to delete). A relation between the new UV edge and the 3D curve is then also stored.

But this boolean is not required at first. The plan is to only use the natural boundaries of NURBS like the current NURBS do. So for rendering, only a simple mesh grid is needed (also like current system).

However I do not have sufficient insights on where the evaluated data will be stored. Currently for curves it is not in the DNA right ? Is it on the render/overlay engine side ? Or is just before ? (I will probably use the remaining time to try to find out).

Okay, sorry, will clarify:

  1. Here is a boolean when you want to cut one polygon on a surface by other polygon on another surface so in result you’ll get new polygon on first surface. So you’ll need to have a projection algorithm to construct a curve of intersection of one surface by another one, and boolean to cut original polygon by that curve. This is needed for modeling.
  2. Second boolean happened at point you need to generate a mesh from a polygon curves so you need (in case you want to support a holes in a polygons (or in another hand you plan to support proper simple polygons output in boolean of first point)) to cut one polygon from another.
    If you not mean to add new mesher for a curve polygons on a surfaces then you’ll be limited by only-2d delaunay algorithm currently blender have (like issues with point density when you want to project curved surface with high degree on a UV plane).

If I am not mistaken, this is not how CAD kernels do it. They use polygons only for display, every thing else is done with continuous maths.
Anyway, this is out of scope for GSoC.

3 Likes

If anyone finds any mistake, please tell me :pray:

Hey i am not sure if this is helpful, but for blender right now is the one that can have CAD embedded into the viewport through the plasticity 3d blender bridge addon when plasticity 3d opened for bridging of course, in plasticity you can edit the surfaces and stuff and it updates the preview in blender almost in realtime…

The main goal is create you’re own “Plasticity/ CAD Like” but for/in Blender… Without depending of any tierce or other software ! With no geometry nodes ! Simply :wink: Is the goal of @RomainGuimbal

No, that’s not what i meant… and of course plasticity has greater advantage and other surfacing tools and xnurbs using the Parasolid cad kernel, but what i meant is for him to check that out to see how that works internally in that bridge in the perspective on how a real cad surface/solid could be embedded in the blender viewport as if it was done directly in blender…

I will not work for commercial software for free :grimacing:

2 Likes

what?? you didn’t get it either? :roll_eyes::expressionless:

in what part did i stated that you should work for them or something like that? :joy:… i am talking about studying how they did it in the free blender addon and not that you gotta work for them to learn how to do it in blender or to implement something else out of the scope… and to test that if only you want to you can use the trial version of Plasticity for testing that https://www.youtube.com/shorts/H2Y7X4lDiXc…

Working for them is indeed very exaggerated, but I have this feeling Plasticity is constantly trying to hug Blender while not being open source and this makes me uncomfortable. But this is going out of topic. We can talk about it elsewhere if you want.

5 Likes

hmmm ok, then no interested no problem bro :sweat_smile::+1:

1 Like