Silk: a NURBS workbench

Need help, or want to share a macro? Post here!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
emills2
Posts: 868
Joined: Tue Apr 28, 2015 11:23 pm

Re: Silk: a NURBS workbench

Post by emills2 »

another reply i added to u/Guilded_Soldier on gnosys' reddit post....just pulling info into this forum thread.
Yep this was my post. Really surprised to see the FreeCAD pros take it seriously to produce the desired model. As a beginner, all of this is going over my head.
your point is valid and the criticism is well taken. In fact very few 'FreeCAD Pros' use it at all. you can see my post below [above on this forum] about what i would like to do for organization...but it is merely a wishlist.

I released this workbench originally for 2 reasons:
-people asked me to after i posted pictures of results on the FreeCAD forum
-it has in fact been ready for tasks like gnosys did here from the very first day of release.

I consider this workbench to be in 'library' state...you can use it to build stuff, and the current tools will always be around, but it is lacking the top level tools...so you have to be your own top level tool.

example of an obvious higher-level tool:
-if i select 4 sketches and hit cubic surface, create and nest the polys and grid automatically.

right now its 4 times sketch>poly
then select the 4 polys > grid
then grid > surface

absorbing the sketches in the polys, and absorbing the polys in the grid seems like a no brainer right? But i want to use each sketch in many polys. and use each poly in many grids. and use each grid in different surfaces and even several other derived grids....

so things disappearing when you 'use' them is not always helpful...and there needs to be an override...and FreeCAD Part Design workbench won't let me share between parts and bodies...so i can't integrate in part Design...but Part Design has all the tools i realy want to use after i finish the surface....

this last one is already doable, and AndyK has shared models with me that demonstrates this. I myself have not yet experimented extensively with Part Design after Silk. I usually check my surfaces by building solids in Part, but this is more QC then workflow.

this tool is definitely not recommended for beginners. you need to be very solid on sketching, Part Design Sketching vs Sketcher Sketching...very solid on using the advanced features of the placement/attachment tool...you need to know how you intend to use the final surface...which is the next workbench? what are it's limitations.

I don't control any of these things, so i stick to super simple objects, that make sense with each other. basically, FreeCAD is giving me plastic, and i'm giving you legos. not playmobil. you can put my legos on a playmobil pirate ship if you want, and sometimes you might like it, but it's out of my control

Although there is no single best way to create the model structure, there definitely are many things that could be done to keep the clutter under control. I freely admit that i have slacked on this...due to both laziness and the issues i detail in my post below [above on this forum]
emills2
Posts: 868
Joined: Tue Apr 28, 2015 11:23 pm

Re: Silk: a NURBS workbench

Post by emills2 »

(i'm trying to link my Silk posts in other subforums to this thread so i can find them later myself)

an example model i did for a question in the help forum a while back. uses a new grid type that i had not presented here. this grid type produces true spheres, ellipsoids, revolutions, "ellipsoidal revolution", and "bezier sweep revolutions". it'll take make many different sets of 3 polys as input, but doesn't make all that much sense except for spheres, ellipsoids...stuff to make 3-4 sided caps in general. currently doesn't give tangency to neighbor grids automatically, but the resulting surface can be segmented and blended.

viewtopic.php?p=566151#p566151
emills2
Posts: 868
Joined: Tue Apr 28, 2015 11:23 pm

Re: Silk: a NURBS workbench

Post by emills2 »

(i'm trying to link my Silk posts in other subforums to this thread so i can find them later myself)

an example model with a very compact model tree as an alternative to a model with a surface of 2381X2 poles. passes basic boolean check, but thickness/offset still had issues at the time.

viewtopic.php?p=521702#p521702
emills2
Posts: 868
Joined: Tue Apr 28, 2015 11:23 pm

Re: Silk: a NURBS workbench

Post by emills2 »

(i'm trying to link my Silk posts in other subforums to this thread so i can find them later myself)

model of a hand grip on a ring/hoop/torus, shows how to connect G1/G2 to a torus. how to draw and use arcs drawn on a torus to join Silk surfaces to a revolved body.

viewtopic.php?p=486716#p486716
andyk
Posts: 11
Joined: Wed Oct 28, 2020 12:48 am

Re: Silk: a NURBS workbench

Post by andyk »

Thank you for the interesting and robust tools Edward.

Been slowly learning and using Silk for a couple years, the most recent "actual" project I used them on was re-reworking (and re-re-reworking) a design for a vacuum hose coupling for a power tool. Silk makes it possible to blend the very complex profile of the powertool outlet to a relatively small inlet for the vacuum in a very compact sweep, keep it highly adjustable, and minimize curvature. By that last aspect I mean in comparison to the Curves WB Blend Surfaces, you can connect weird profiles at right angles to one another with a shorter sweep path while having equal or better continuity.

Image
version 3 which was made for the festool

Image
version 4 which was made for 2" spiral hose

This part is one of a large number I've designed in a multi-year project trying to make every hand-held power tool in my workshop capable of plugging into our festool vacuums really nicely. Designs are published here on this repo: https://github.com/UBC-AHVA/Festool_Nozzles
emills2
Posts: 868
Joined: Tue Apr 28, 2015 11:23 pm

Re: Silk: a NURBS workbench

Post by emills2 »

Very nice collection Andy. Nice to see that you have figured out a workflow from Silk to Part Design bodies as well. It makes me very happy to see Silk applied to a practical problem.

Thanks for sharing, and for your tooltips contributions.
User avatar
michacassola
Posts: 23
Joined: Fri Feb 17, 2023 10:17 am
Contact:

Re: Silk: a NURBS workbench

Post by michacassola »

Hey @emills2 , thank you very much for this workbench!
I downloaded https://github.com/edwardvmills/Silk/bl ... o_01.FCStd and opened it in the latest Link Daily by realthunder and had to remove some redundant constraints and unfortunately got the following error:
'FeaturePython' object has no attribute 'autoG3'
for ControlGrid64_2Grid44, ControlGrid64_2Grid44001 and ControlGrid64_2Grid44002.

Also, I cannot reconstruct how you did this example.
Would you be so kind and make a tutorial for that please?

Also, can there be more than 6x6 grids to form one surface or will they have to be assembled like in the example?
emills2
Posts: 868
Joined: Tue Apr 28, 2015 11:23 pm

Re: Silk: a NURBS workbench

Post by emills2 »

michacassola wrote: Tue May 30, 2023 10:49 am Hey @emills2 , thank you very much for this workbench!
I downloaded https://github.com/edwardvmills/Silk/bl ... o_01.FCStd and opened it in the latest Link Daily by realthunder and had to remove some redundant constraints and unfortunately got the following error:
'FeaturePython' object has no attribute 'autoG3'
for ControlGrid64_2Grid44, ControlGrid64_2Grid44001 and ControlGrid64_2Grid44002.

Also, I cannot reconstruct how you did this example.
Would you be so kind and make a tutorial for that please?

Also, can there be more than 6x6 grids to form one surface or will they have to be assembled like in the example?
New version of Silk_Demo_01.FCStd has been put on the repo, which will fix the missing attributes. most of the redundant constraints should be fixed as well, but that's not guaranteed. sometimes FreeCAD will add constraints all by itself, and claim redundancy, on a sketch that was fine a moment before, during the session in which the file is originally created. In the case of this file, the sketcher rules have changed over the years, and i have tried to go through and fix them all.

As far as a tutorial, this is a very complex model, and it covers a LOT of ground. May i ask: did you see and try the old tutorials here?https://github.com/edwardvmills/NURBSlib_EVM (down towards the bottom)
they are old but do cover some basics. because Silk is now a workbench, you can skip the whole setup portion, and all the instructions about adjusting colors.

Those old tutorials won't get you all the way to the model in the file we're talking about above, but they cover essential features.

If you have indeed done these tutorials, or figured out how to get that far already by yourself, i usually end up doing a video call to explain things. That way, we can skip over the stuff you know and focus on what's missing. can you post some pictures of what you have managed to replicate, or what you have done in another WB or program that you wish to accomplish with Silk?
Also, can there be more than 6x6 grids to form one surface or will they have to be assembled like in the example?
I think there's a word missing in that question, so i'm going to guess here, that maybe, you wish to place multiple 6x6 surfaces side by side, instead of using them, as i do, to fill a hole between 6x4 surfaces (themselves nested between 4x4 surfaces)?

you can make your own 6x6 (or 64) grid from scratch (not recommended), by drawing your own 6 point control polygons (not recommended), by feeding in sketches of 5 lines drawn end to end (not recommended), or feeding in 2 extended nodes (add one line segment to end of the first, super extra not recommended), or feeding an existing 4 control point curve, which will convert it to a 6 point version.

the reason it's not recommended is because, although these object can be built manually, they are intended as blending tools between 4 point curves and 4x4 surfaces. when used as blending tools, they are automated (but adjustable). very little consideration was given to make them effective at direct modeling, but some users have had success doing so. it depends on the degree of refinement you need in the end.
emills2
Posts: 868
Joined: Tue Apr 28, 2015 11:23 pm

Re: Silk: a NURBS workbench

Post by emills2 »

michacassola wrote: Tue May 30, 2023 10:49 am ...
expanding a little bit on what i said above. there is a very important fact that is not necessarily obvious: it is impossible to exactly reconstruct and match a 6x6 surface that was prepared through blending simply from its boundary curves.

if you were to extract the boundaries of the blended 6x6 surface, and then feed them back into a 6x6 grid, you would NOT replicate the blended 6x6 grid. you would get another surface/grid, that does fill the hole, in a crude way. this reconstructed face would NOT have the same level of continuity to the surrounding surfaces. blends, both 6x4 and 6x6, take into account the surfaces, not just the edge. the edge curves simply do not contain enough information for the job.

when we take 4 edges of type '4' to build a 4x4 grid, Silk has to decide how to place the inner control points (12 points are along the edges, 4 points are 'inner). there is no 'right way' to do this. the method i use creates parallelograms in the corners of the grid. this allows one to create tangent surfaces by reference to the edges alone, and is a reasonable default. but it is not the only way.

once you have a default 4x4 grid, there is a modifier available: ControlGrid44_flow (select default ControlGrid44 and apply function)

this breaks the parallelograms in the corners, and creates gentler transitions within the grid. when we intend to blend hard corners, this is great, but it breaks the predictability of tangents, and the ability to model neighboring patches directly (as tangent).

direct modeling of final surfaces (no blending) is only appropriate in limited circumstances: matching to a flat surface, cylinder, or sphere. AndyK, who shared his work above viewtopic.php?p=675315#p675315 has taken this to a higher level than i ever have.

I blend, and i only directly model 4 point curves, and 4x4 point surfaces. i compose large groups of surfaces from these (kind of like a rough mesh), and then blend away hard corners (kind of like a subdivision applied to a mesh).

long term (when i have all the workflow settled), i will add 5 and 6 point BEZIER curves and surfaces to the base modeling tools (the current 6 points tools are NOT bezier, because bezier sucks for blending).


here's an example where i actually use 'CAD' tools to model the rough version, then add 4x4 surfaces on all faces, then blend.

this is only to make a point about the workflow and where the complexity lies, the base surface don't have to be flat, or cylindrical. go wild with the 4 point curves and 4x4 point faces. if you run out of design freedom in a 4x4 surface, it's time for one more surface, not more points in the same surface (in this current setup). As i said, i intend to add 5 and 6 point beziers eventually. and it still won't be enough. more points will never be enough, one MUST learn to compose surfaces, and deal with the joints as their own issue.
CadDivision_19_03_small.png
CadDivision_19_03_small.png (463.53 KiB) Viewed 1241 times
User avatar
michacassola
Posts: 23
Joined: Fri Feb 17, 2023 10:17 am
Contact:

Re: Silk: a NURBS workbench

Post by michacassola »

@emills2, thank you very much for your answer!

The shoe last shell I am trying to create is proprietary so I cannot share the actual file or screenshots, but I made a simplified proof of concept that I can share some screenshots of.

My problem is that the Gordon NURBS surface I create with the Curves WB is too bumpy as I use more profiles and curves as in the example below, so I hoped that the Silk WB can help, but I think it might not be a fit, as I need one surface as the shoe last shell.

I create the surface with interpolated curves from sketch points and other curves:
Screenshot 2023-05-31 094455.png
Screenshot 2023-05-31 094455.png (378.9 KiB) Viewed 1175 times
It has to be one surface as I use the TrimmedFace functionality to get "shoe part" surfaces (The blue lines are a sketch that gets projected to trim the surface):
Screenshot 2023-05-31 095326.png
Screenshot 2023-05-31 095326.png (203.85 KiB) Viewed 1175 times
And I tried to find functionality to actually join surfaces in FreeCAD yesterday to get one surface from many 4x4/6x4/6x6 so I can do the step from the second picture, but it simply does not exist. All there is, is compounding which is just several surfaces in one container object...
Maybe I can use the curve functionality to then join curves in the Curves WB and have a Sub-D like cage thanks to your Silk WB.

I did go through the tutorials, but did not do them. I am first of all researching, if my desired end result can be achieved and "Silk" sounded right to get a bumpy surface smooth.
Post Reply