NURBS Surface modeling tools focused on low degree and seam continuity (FreeCAD Workbench)

edwardvmills, updated 🕥 2023-04-01 21:06:16

Silk Workbench

example of current capability

Description

NURBS Surface modeling tools focused on low degree and seam continuity (FreeCAD Workbench). Silk is the new name of the NURBSlib_EVM project.

NURBS: smooth curves and surfaces whose form is controlled by a relatively small number of "control points", which sort of float close to the curves and surfaces. As their name indicates, the "control points" are what the user modifies in order to control the curves or surfaces. The "refinement" of a NURBS is controlled by its degree, and the "distance of effect" of a control point is controlled by the knot vector of the NURBS.

example of current capability

Low Degree: Silk NURBS curves and surfaces are of the minimum degree suitable for the intended goal. The knot vectors are kept to a small consistent set. Often with NURBS modeling problems, the apparent solution is to increase the degree and number of knots. While this is perfectly valid, it raises the computational difficulty and organizational challenges of the control points. Silk aims to provide tools of the absolute minimum mathematical complexity for each problem solved.

Seam Continuity: Silk's goal is to allow complex models to be built from individual NURBS sections, alternatively creating new surfaces to be continuous to existing surfaces, or providing tools to to create smooth transitions where surfaces are initially created with discontinuities.

FreeCAD does the heavy lifting:

-providing a planar sketch interface that we can locate anywhere in 3D space to manipulate simple groups of very few control point (Silk can use multiple sketches in different planes to construct truly 3D curves and surface edges).

-drawing the beautiful and smooth surfaces once appropriate control grids have been prepared using Silk tools.

Silk merely provides methods for combining these simple sketches into control point grids, which FreeCAD converts to NURBS surfaces.

The animation below demonstrates fine surface tuning through sketches with full engineering control of curve and surface continuity. Notice the low number of control points used on the profile control sketch. Up to a certain complexity, Silk updates virtually in real time with sketch editing.

example of current capability

Limitations

Although Silk is intended to provide efficient and user friendly tools in the long term, at this time, it behaves more like a low level library with GUI access to its functions. The individual functions create individual document objects, and in the future, relevant functions might be chained together automatically to create complex nested objects. The current objects are very likely to persist, both as individual document objects, and as sub-objects in the future.

Modeling can be done in the current state, and the resulting data structures are efficient, but the process can be laborious. The best path forward for user friendliness will depend heavily upon the outcome of several debates within the FreeCAD community on how parts, solid bodies, assemblies, and object linking are organized.

In the meantime Silk does offer a few tools not otherwise available in FreeCAD (eg. 3D splines), and can in general be seen as a sandbox for surface design, control strategies, data structures, and algorithms.

example of current capability

Installation

Recommended installation is through the FreeCAD Addon Manager via Tools -> Addon Manager

Documentation

Until documentation and tutorials are rewritten for Silk, NURBSlib_EVM is the best source of information regarding the project. The tutorials can still be followed, simply skip setup, color, and display mode instructions. All setup is handled by installing the workbench, and the object display properties have been set to reasonable defaults. (Silk Wiki in progress)

Licence

All program files (.py, .pyc, .FCMacro) are offered under the terms of the Gnu gpl-v3.0

gplv3

Icon .svg files, icon .png files, demo models .FCStd files, and tutorial model .FCStd files are offered under the terms of CC-BY 4.0

Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 International License.

Issues

Improve tooltips for icons so they actually describe what they do

opened on 2021-07-08 02:16:23 by luzpaz

Right now, many of the icons are just placeholder names of the icon name, for example: https://github.com/edwardvmills/Silk/blob/master/ControlGrid66.py#L57

Create the surrounding ruling surfaces for a four corner surface

opened on 2021-07-03 08:20:48 by parnasist3

Hi Edward, hope you are alright? We haven't heard from you in a while?

I created a topic General surface creation with emills2 "Silk" in the FreeCAD forum where I asked you if you could show me how to create a general surface. Where the hard part is to create the surrounding ruling surfaces.

The ruling surfaces shall be created in such a way that each corner is forced to be, at least, tangent to the local plane. This will gaurantee tangency with the neighbouring surfaces.

As can be seen in the model, the first corner-point is parent for the other three corner-points. Each corner-point is parent for the two vector-points making up the ends of the directional vectors per corner. Each plane is defined by the corners directional vectors/lines, hence creating a way of forcing everything to be, at the very least, tangent to each other.

So, by having everything connected to the first point it is easy to move the whole package around with just one set of [x,y,z] values and still having everything fully parametric.

But the best part is that it will be rock steady with respect to TopoNaming!

Error on basic tutorials

opened on 2020-12-28 04:38:14 by PJTraveler

I'm using the NURBLsLib tutorials on SILK in OS: Windows 10 (10.0) Word size of OS: 64-bit Word size of FreeCAD: 64-bit Version: 0.19.23463 (Git) Build type: Release Branch: master Hash: adc6db8f32c17e9f67cb82aa7962d1e42ce061c6 Python version: 3.8.6 Qt version: 5.12.5 Coin version: 4.0.0 OCC version: 7.4.0 Locale: English/United States (en_US) 2020-12-27_20-33-53

When trying to create a control polygon and then curve I get the errors shown in the screen capture

Video manual

opened on 2017-08-20 20:15:49 by PrzemoF

Please consider making a short video manual showing basic functions. I played with the workbench for ~2 hours and I failed to go beyond creating cubic curve and I'm not sure if it's my lack of knowledge or errors in the code.

Code formatting

opened on 2017-08-20 20:08:37 by PrzemoF

Please consider using python code auto formatting tools, like autopep8 [1]. [1] https://pypi.python.org/pypi/autopep8

Releases

Workbench migration 2017-07-03 19:11:11

Basic migration of NURBSlib_EVM tools

nurbs sketch g2 g3 bezier surface python freecad