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!
Post Reply
User avatar
PrzemoF
Veteran
Posts: 3520
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Re: Silk: a NURBS workbench

Post by PrzemoF »

phpBB [video]
User avatar
PrzemoF
Veteran
Posts: 3520
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Re: Silk: a NURBS workbench

Post by PrzemoF »

emills2 wrote: Wed Aug 23, 2017 1:56 am[..]
before you get deep into the kayak, i gotta tell you about a very important trick: the 'De Casteljau' treillis (recommend coming back and reading the link after the rest of the post).[..]
I highly recommend to spend some time to understand how the De Casteljau sketch works - it makes adjusting the curve very easy. Thanks emills2!
User avatar
PrzemoF
Veteran
Posts: 3520
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Re: Silk: a NURBS workbench

Post by PrzemoF »

Some ideas:
1. Creating point on curve (Point_onCurve) after the curve was selected in the tree results in error. Instead the point should be created with u=0.5
2. Editing u value in editor (up/down arrows) gives it value over 1.0. I think there should be a way of defining allowed range.
Edit:
3. When creating segment points and curve has to be in the same group otherwise the operation fails with:

Code: Select all

Traceback (most recent call last):
  File "/home/przemo/.FreeCAD/Mod/Silk/ArachNURBS.py", line 1534, in execute
    curve=fp.NL_Curve.Shape.Curve
<type 'exceptions.AttributeError'>: 'Part.Vertex' object has no attribute 'Curve'
4. Creating segment requires selecting 2 points and curve, but the points are already on the curve. Can we use i.e. first selected point to determine the curve? That would save user selecting the curve. Currently if gives (with 2 points selected):

Code: Select all

Running the Python command 'ControlPoly4_segment' failed:
Traceback (most recent call last):
  File "/home/przemo/.FreeCAD/Mod/Silk/ControlPoly4_segment.py", line 36, in Activated
    Point_onCurve_1=selx[2].Object	# this is a resilient link to the underlying object

list index out of range
5. I wanted to create a segment using one added point and one of the end points. I can select all 3 as required, but it generates error:

Code: Select all

Running the Python command 'ControlPoly4_segment' failed:
Traceback (most recent call last):
  File "/home/przemo/.FreeCAD/Mod/Silk/ControlPoly4_segment.py", line 36, in Activated
    Point_onCurve_1=selx[2].Object	# this is a resilient link to the underlying object

list index out of range
More to come... I'm making good progress with the kayak :D
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: Silk: a NURBS workbench

Post by triplus »

It's nice to being able to create such surfaces (in rather straightforward fashion) in FreeCAD isn't it? ;)
emills2
Posts: 889
Joined: Tue Apr 28, 2015 11:23 pm

Re: Silk: a NURBS workbench

Post by emills2 »

hammax wrote: Fri Aug 25, 2017 10:08 am But now I am stopped when generating the 4x4-mesh.
I finished with surfaceWB to see a result at all.
How to go on, the "old tutorial" does not help any more.
Hi hammax, i hope you saw the video that przemof did for you.
PrzemoF wrote: Fri Aug 25, 2017 12:43 pm
phpBB [video]
did you follow all three "old tutorials" and get stuck because it wasn't clear the 44 grid could be used for triangles as well?

i attached a version of your canoe (like przemof did, with grid44 and surf44) with all side to illustrate a point: using the 44 grid and surface for a triangle should be an absolute last resort, because there is a collapsed/degenerate edge.
in the picture below, i highlighted one edge on the control grid (gren line). it runs in diagonal and the other corners of the grid don't have this "extra" edge
hammax_Silk_1_01.PNG
hammax_Silk_1_01.PNG (299.05 KiB) Viewed 3326 times
this extra edge is actually 2 control lines on top of each other! and the corner at the front of the canoe is actually 3 lines collapsed to a point. because of these collapsed segments, you will get really unexpected behaviour if you try to trim and blend this triangle.

the collapsed edge is always created at the corner of the firs and last edge you select for ControlGrid44. So you can decide where to "hide the weird point".

in your case, the basic shape of the canoe is basically done. maybe the bottom center point is a good location to hide the collapsed point. this way, the rim would be a clean workable surface to fold over inside the build the full shell.
Attachments
Silk_1.FCStd
(135.33 KiB) Downloaded 83 times
emills2
Posts: 889
Joined: Tue Apr 28, 2015 11:23 pm

Re: Silk: a NURBS workbench

Post by emills2 »

PrzemoF wrote: Fri Aug 25, 2017 1:45 pmSome ideas:
1. good idea, but i would probably do u=0.25, so you get immediate feedback on which way u runs.
2. i never use the arrows myself, but even missing the decimal point can jump u to 25 and hang the model....fully agree, the values should be bound.
3. i don't understand what "same group" means in your example, so i can't really follow the error message.
4. actually the points could be anywhere! when there are 4 curves meeting, i usually only create one point on the corner. i never define the same point twice. segmentation remaps the points to the curve to be segmented by projection

Code: Select all

u0=curve.parameter(fp.Point_onCurve_0.Position)
not by direct assignment of Point_onCurve.u to the segmentation span.

as far as automatically creating points if only one point is specified...i think this has to wait until the nesting structure is figured out. it seems like good progress is happening on the PDN side for that. i'm going to wait it out! once the nesting structure is formalized....we have a logical place to put automatically created objects. long term, control polys and control grids will probably be hidden by default in folders under curves and surfaces.

5. a curve endpoint in the viewport is not a valid Point_onCurve, sorry. sure, it could be automatically created, same story as above. i don't want to use the curve endpoint directly because it doesn't feel topologically safe.


In general, i agree with everything, but i have a very limited amount of time. from the dev plan on the wiki
Needed:

convenience: more point on curve methods (at curve intersection, surface intersection, etc)
convenience: point on surface methods
convenience: more segmenting methods
convenience: automatically cut out the inner 1/3 of the 3Quad triangle, add new 3Quad triangle inside to reduce center defect << NEXT FOCUS
modeling tool: isoline extraction
modeling tool: crude normal offset. maintains order and pole count.
modeling tool: add control points to curves and surfaces to give additional design freedom away from the seams
core function: map the center of a 3Quad triangle to an ellipsoid section to eliminate the UV 'star' point
core function: 5 face blending strategy << NEXT FOCUS
core function: 6 face blending strategy
core function: automatic G3 'seeking' for 6 point poly based curves and surfaces. This function can probably use a numerical method instead of an exact algebraic solution.
core function: raise degree as needed to improve continuity, both at the seams, and at internal knots.
luckily, the 3Quad, 5 face, and 6 face issues are solved as NStar grids and surfaces, but there is a lot of theoretical stuff left to prove. i want to avoid ending up with a fresh paint job on a car that doesn't run. so once i have an object that covers all cases theoretically, i move on. so i only have one point creation method, and only one segmentation method. The important thing to me, is that although you have to create more objects than seems really necessary, the data is not duplicated, and the parametrization is clean.

if i had been 100% CERTAIN my scheme would produce good results when i started, i could have made a few things better/cleaner along the way. But i didn't really know if anything was going to work out. Until i actually trim the center of my star surface, close the gap, and observe center defect reduction, this is all still a gamble. i'm pretty optimistic right now ;) .
emills2
Posts: 889
Joined: Tue Apr 28, 2015 11:23 pm

Re: Silk: a NURBS workbench

Post by emills2 »

PrzemoF wrote: Fri Aug 25, 2017 1:45 pm More to come... I'm making good progress with the kayak
i'd love to see some progress pics/models if you don't mind sharing :)
User avatar
PrzemoF
Veteran
Posts: 3520
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Re: Silk: a NURBS workbench

Post by PrzemoF »

I'm testing different ideas, so the progress is a bit slower. I used dxf import from inkscape and some tricks from descriptive geometry [1] that I learnt long, long time ago. They come handy when creating 3D from 2D photos. :D
My current idea is to make a few cross sections in important places and build the surfaces from those cross sections. That should allow to make a seamless model if I can do something with the bow and the stern.

[1] https://en.wikipedia.org/wiki/Descriptive_geometry

The model (too big for forum): https://geofinder.eu/owncloud/public.ph ... 4&download
Zrzut ekranu z 2017-08-26 22-51-14.png
Zrzut ekranu z 2017-08-26 22-51-14.png (319.24 KiB) Viewed 3295 times
Zrzut ekranu z 2017-08-26 22-51-25.png
Zrzut ekranu z 2017-08-26 22-51-25.png (331.19 KiB) Viewed 3295 times
Zrzut ekranu z 2017-08-26 22-51-45.png
Zrzut ekranu z 2017-08-26 22-51-45.png (167.54 KiB) Viewed 3295 times
Zrzut ekranu z 2017-08-26 22-51-53.png
Zrzut ekranu z 2017-08-26 22-51-53.png (322.22 KiB) Viewed 3295 times
Zrzut ekranu z 2017-08-26 22-52-19.png
Zrzut ekranu z 2017-08-26 22-52-19.png (294.17 KiB) Viewed 3295 times
Zrzut ekranu z 2017-08-26 22-55-18.png
Zrzut ekranu z 2017-08-26 22-55-18.png (166.32 KiB) Viewed 3295 times
Zrzut ekranu z 2017-08-26 22-57-07.png
Zrzut ekranu z 2017-08-26 22-57-07.png (30.19 KiB) Viewed 3295 times
I had multiple small problems (sketch scaling, Draft wb scaling, svg import crash, external geometry loses links), but now I think I have a good idea how to go from 2D photos to cross section to preliminary surface to the final version.
User avatar
PrzemoF
Veteran
Posts: 3520
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Re: Silk: a NURBS workbench

Post by PrzemoF »

@emills2, I really like your idea of making the wb bulletproof :D

I can't recreate the group problem, so it was something else, not groups. Please ignore it for now - if I can make a test case I'll post the details.
User avatar
PrzemoF
Veteran
Posts: 3520
Joined: Fri Jul 25, 2014 4:52 pm
Contact:

Re: Silk: a NURBS workbench

Post by PrzemoF »

A sample of the next step - fine tuning the sections:
Zrzut ekranu z 2017-08-27 00-24-18.png
Zrzut ekranu z 2017-08-27 00-24-18.png (278.72 KiB) Viewed 3287 times
Zrzut ekranu z 2017-08-27 00-24-27.png
Zrzut ekranu z 2017-08-27 00-24-27.png (286.26 KiB) Viewed 3287 times
Zrzut ekranu z 2017-08-27 00-26-10.png
Zrzut ekranu z 2017-08-27 00-26-10.png (301.39 KiB) Viewed 3287 times
Post Reply