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: 875
Joined: Tue Apr 28, 2015 11:23 pm

Re: Silk: a NURBS workbench

Post by emills2 »

[edit: forgot to quote for notification]
michacassola wrote: Wed May 31, 2023 8:17 am
[edit: conclusion first. i am fairly certain that both of your objections, about joining multiple surfaces, and effectively trimming them with arbitrary curves, can be satisfactorily dealt with. this is true for Silk, and any other method you may want to use to generate multiple surfaces, like Curves WB, or Surface WB]

I don't know if Silk will be up to what you need, but since the Gordon surfaces are no longer meeting your needs, it's worth an exploration.

Ignoring Silk itself for now, i want to tell you about some non obvious FreeCAD features. everything i show below is possible through the Part WB, but i definitely recommend using the Curves WB version of some of these tools, since Curves WB produces parametric versions of the same operations.

joining surfaces: 2 options, one theoretical, one practical

option 1: Part WB, tool: shape builder, option: shell from faces. this stitches any group of surfaces into a shell patch. now it is considered one surface by other operations.

option 2: Curves WB, tool:makeParametricSolid. if the chosen set of surfaces is closed, it makes a solid, but if it has a hole, the tool returns a shell (grouped surfaces). the final object is a the same as shell from faces, but it is parametric and will update.

below, i ctrl-select all the Silk surfaces from my fin model, click make ParametricSolid, and it returns a unified shell
michacassola_01_01.PNG
michacassola_01_01.PNG (321.85 KiB) Viewed 1224 times
projected curve: this actually falls under the topic of intersecting surfaces, which solid booleans do all day long. the key is that since FreeCAD can do it with solids, it can also do it with surfaces. always. because the solids are nothing more than their bounding surfaces (this is what B-Rep, boundary representation is all about. all modern CAD is B-Rep).

your projected curve is actually the intersection curve of the extrusion of your cutting curve with your design surface.

easier with pictures:

i prepare my cut curve, but instead of 'projecting' it by specifying a direction, i extrude it as a surface (make solid = false)
michacassola_01_02.PNG
michacassola_01_02.PNG (168.22 KiB) Viewed 1224 times
michacassola_01_03.PNG
michacassola_01_03.PNG (425 KiB) Viewed 1224 times
michacassola_01_04.PNG
michacassola_01_04.PNG (311.86 KiB) Viewed 1224 times
so now i have some overlapping surfaces. notice that the intersection of these surfaces produces the type of cut you showed, but it skips the projection step.

if the objects were solids we could use various booleans: cut, union, intersection...

i'll show those individual cases later, but right now, lets go straight to the best tool: Part WB, tool: boolean fragments (without creating solids)

select both surfaces, apply boolean frgaments. from the result, i can select individual cut pieces
michacassola_01_05.PNG
michacassola_01_05.PNG (234.96 KiB) Viewed 1224 times
Last edited by emills2 on Thu Jun 01, 2023 4:16 am, edited 9 times in total.
emills2
Posts: 875
Joined: Tue Apr 28, 2015 11:23 pm

Re: Silk: a NURBS workbench

Post by emills2 »

and use makeParametricSolid again to re-stitch them.
michacassola_01_06.PNG
michacassola_01_06.PNG (171.62 KiB) Viewed 1219 times
[continued]
emills2
Posts: 875
Joined: Tue Apr 28, 2015 11:23 pm

Re: Silk: a NURBS workbench

Post by emills2 »

i made a surface from the cutting curve, mostly because if i had let be a solid, i wouldn't be able to see and select the little pieces inside.

in this case, i could have extruded as solid, and done 'intersection' / 'common' instead of boolean fragments.

the nice thing about boolean fragments is it gives you all possible pieces, so you can stitch them into different groups (shells) from one single fragment operation.

now lets go one step at a time, using the traditional approach of a single boolean operation that returns a single object.

make the cutting object solid (by setting the option in the extrude)
michacassola_01_07.PNG
michacassola_01_07.PNG (226.66 KiB) Viewed 1207 times
and this time, do a boolean 'common' operation between the silk shell and the cutting object
michacassola_01_08.PNG
michacassola_01_08.PNG (170.46 KiB) Viewed 1207 times
ok, nice and straightforward, i don't have to select and restitch a dozen itty-bitty pieces. it just spits out the pieces i want, still stitched to each other.

[continued]
Last edited by emills2 on Thu Jun 01, 2023 4:02 am, edited 2 times in total.
emills2
Posts: 875
Joined: Tue Apr 28, 2015 11:23 pm

Re: Silk: a NURBS workbench

Post by emills2 »

so boolean fragments gives you all possible pieces, and this is great if you intend to reconstitute the entire surface into different groups. it also works directly from surfaces, no solids needed.

single boolean operations go straight to the point, give you a pre-stitched object, but you need at least one solid for it to work.

but there's more! why do this instead of a projection tool? because we haven't even scratched at the capabilities:
cutting with non planar curves & complex geometry.


i want to cut along a sphere. there is no sketch that can be projected for this. i will use a boolean cut to produce the final shell
michacassola_01_09.PNG
michacassola_01_09.PNG (240.95 KiB) Viewed 1196 times
michacassola_01_10.PNG
michacassola_01_10.PNG (196.95 KiB) Viewed 1196 times
and i want a completely 3D and composed cutting curve based on a complex surface. i will use a boolean common (/intersection) to produce the final shell
michacassola_01_11.PNG
michacassola_01_11.PNG (293.33 KiB) Viewed 1196 times
michacassola_01_12.PNG
michacassola_01_12.PNG (130.15 KiB) Viewed 1196 times

so anything that you can imagine a solid doing, you can get in a surface. and you don't even have to make the solid if you use fragments! any surface, quick or refined, throw EVERYTHING into a boolean fragments, pick and choose what you like, and restitch.
Last edited by emills2 on Thu Jun 01, 2023 3:09 am, edited 1 time in total.
emills2
Posts: 875
Joined: Tue Apr 28, 2015 11:23 pm

Re: Silk: a NURBS workbench

Post by emills2 »

When i complain about complex/heavy tools, like trim, and say to not use them with Silk, what i mean is:
-do not use them until you are finished with Silk, and satisfied with your 'design' level surfaces.
-once you no longer need Silk, do whatever you want: make an offset, make a solid, make a shell, trim it, cut it, whatever you like
-but do not expect a trimmed edge to be workable within Silk (i.e, usable to make more new Silk surfaces).
-it's a one way street.
Last edited by emills2 on Thu Jun 01, 2023 3:10 am, edited 2 times in total.
emills2
Posts: 875
Joined: Tue Apr 28, 2015 11:23 pm

Re: Silk: a NURBS workbench

Post by emills2 »

Super important and amazing: if the cutting curve is easy to draw directly, like a sketch on a plane, you don't need to make an extruded surface or anything.

just throw the sketch itself into boolean fragments! the fragment itty-bitty pieces will cut along the sketch.

this leads to insane functionality: map curve (like a logo) to face, throw in both the face and the projected curve into fragments, and now you can select a surface with the logo cutout in a single click from the fragments objects

below: create cylinder, slect round face, sketch on surface [edit: this is also in Curves WB*], open sketch, draw a scribble. select sketch on surface object, ctrl select original cylinder, apply boolean fragments.

select main surface in one click, makeparametricsolid (a shell).
michacassola_02_01.PNG
michacassola_02_01.PNG (128.68 KiB) Viewed 1150 times
* i usually assume most people working on surfaces are probably familiar with Curves WB already
Attachments
michacassola_02.FCStd
(24.17 KiB) Downloaded 14 times
Last edited by emills2 on Wed May 31, 2023 11:07 pm, edited 3 times in total.
emills2
Posts: 875
Joined: Tue Apr 28, 2015 11:23 pm

Re: Silk: a NURBS workbench

Post by emills2 »

and it offsets cleanly. truly amazing. things that should be easy, actually being easy? unheard of :)
michacassola_03_01.PNG
michacassola_03_01.PNG (156.43 KiB) Viewed 1147 times
i hope that i was able to convince you that FreeCAD has excellent surface joining and cutting tools. If this issue is sufficiently resolved, i would love to show you more about Silk itself...but i really do need fairly specific questions. there is just too much to say 'in general'. i can see from the project you are undertaking that you have significant knowledge of surfacing. if we can focus on the areas that are unclear to you, we'l get there much better than if i write a 1000 page tutorial for complete beginners, which would need to explain 90% of freecad, some intro vector geometry, etc, etc.
emills2
Posts: 875
Joined: Tue Apr 28, 2015 11:23 pm

Re: Silk: a NURBS workbench

Post by emills2 »

Silk surface quality check - after trimming.

do the example surfaces above behave properly in subsequent CAD operations?
michacassola_04_01.PNG
michacassola_04_01.PNG (112.58 KiB) Viewed 1117 times
michacassola_04_02.png
michacassola_04_02.png (76.34 KiB) Viewed 1117 times
by my standard, yes. it was able to make solid offsets. one was thickened inward, one was thickened outward.

WARNING: now the model is heavy. the offset surfaces are slow to genrate, especially at low surface deviation. these steps should not be performed until late in the game.

FAULT: the offset objects are perfectly matched along the original surfaces, but i cannot make a Silk surface that perfectly matches the offset faces*. creating a third layer would involve approximation. the design strategy must avoid complex third layers, as much as possible. offset of offset is possible, but even heavier.

focus the Silk design on the most central layer, to minimize the number of offsets that will be needed later to produce all the diffrent layers

*this is not really Silk's fault. the offset of a NURBS surface that has, say, 36 control points (6X6) is NEVER another 36 control point surface (except planes, cylinders, spheres, and toruses, which is not helpful for industrial design). it is almost always significantly more complex. this is for true offsets, with constant thickness. however, if we give up exact constant thickness, we can make a 'virtual' offset that maintains the number of control points, and can be fully worked within Silk.

by using a clean Silk surface to approximate a messy (but perfect thickness) offset, we can 'heal' the design periodically and create as many layers as we like, retaining the power to blend at high quality.
emills2
Posts: 875
Joined: Tue Apr 28, 2015 11:23 pm

Re: Silk: a NURBS workbench

Post by emills2 »

looking back, i see you were doing something more involved with your projected curve, and you may wonder if what i showed is really equivalent.

so i go back, delete my sketch spline, and do a line and a circle, like you did.
michacassola_05_01.PNG
michacassola_05_01.PNG (65.02 KiB) Viewed 1086 times
.
extrude, not solid, fragments, select the bits i like, parametricsolid.
.
michacassola_05_02.PNG
michacassola_05_02.PNG (121.72 KiB) Viewed 1086 times
michacassola_05_03.png
michacassola_05_03.png (69.18 KiB) Viewed 1086 times
michacassola_05_04.png
michacassola_05_04.png (123.81 KiB) Viewed 1086 times
.
hey, it put my crappy line partially through a surface, i didn't want that!
guess i need to be more careful in my sketches
.
michacassola_05_06.png
michacassola_05_06.png (14.28 KiB) Viewed 1086 times
Last edited by emills2 on Thu Jun 01, 2023 3:13 am, edited 1 time in total.
emills2
Posts: 875
Joined: Tue Apr 28, 2015 11:23 pm

Re: Silk: a NURBS workbench

Post by emills2 »

everything updates parametrically, but changing the line intersection changed all the internal ID's so my selection of bits and pieces got messed up.

i shouldn't really complain too much here. that really does change things in a way that can't really be automatic. i changed too much.

easy enough to redo: delete last solid, show fragments again, pick correct fragment, make parametric solid, offset as solid
michacassola_05_07.png
michacassola_05_07.png (90.41 KiB) Viewed 1085 times
michacassola_05_08.png
michacassola_05_08.png (90.16 KiB) Viewed 1085 times
michacassola_05_09.png
michacassola_05_09.png (70.6 KiB) Viewed 1085 times
notice the offset thickness faces are not planar, and this is correct for fabric, leather, composite work. this is a good representation of a draped/deformed sheet-like material. if you want planar edges, design oversize, then extrude cut.
Last edited by emills2 on Thu Jun 01, 2023 4:09 am, edited 2 times in total.
Post Reply