Wouldn't it be more practical to use the built-in makeOffset2D function rather than making a function to calculate for every point? Or is this a workaround to some limitation it has?
It doesn't work. Either "result is null" or it crashes. Or there is a magic setting that I didn't find. And it doesn't produce a sketch. And if I make an offset and use Draft.makeSketch to convert it to a sketch, it doesn't put the resulting sketch in the correct location.
Nice tool, perhaps we can integrate it also in the Draft_Offset object? It really lacks some proper curve offset features...
yes, please do. Actually, the part where the wire is transformed into a sketch comes from Draft.makeSketch, but that function produces a sketch that is correctly oriented as the initial wire, but offset. The treatment of the final placement is probably wrong.
Code: Select all
>>> Gui.runCommand('Draft_Offset',0) >>> import Draft >>> Draft.offset(FreeCAD.ActiveDocument.Section002,FreeCAD.Vector(0.1568655751835033, -0.07142428553050592, -2.995044534353171),copy=True,occ=False)
Code: Select all
Pick distance ToDo.doTasks, Unexpected error: <class 'AttributeError'> in ['Draft.offset(FreeCAD.ActiveDocument.Section002,FreeCAD.Vector(0.1568655751835033, -0.07142428553050592, -2.995044534353171),copy=True,occ=False)', 'FreeCAD.ActiveDocument.recompute()']
no, it only does polylines. But it is on purpose, because when you intersect a plane with a warped extrusion, and even if both ends are made with polylines, the section is made up of small BSplines, and that calculation takes a lot of time. This is what I had tried at the beginning, with Draft.makeArray, but it was too slow (probably more accurate but unusably slow)(I tried you tool for Draft_BezCurve and Draft_BSpline, but it seems to just produce a straight lines wire, probably it's not aimed at those objects)
Attached. It's a Part.Extrusion between 2 standard RG15 airfoil sections, imported with the AirfoilImportAndScale macro. They're oriented along XZ and offset and twisted (as a wing should be). It is then cut with a plane done again as a Part.Extrusion along some angles, and both Part.Extrusions intersect with a Part.Section to produce the desired Section, the white line. It's this section – which is planar and in 3D – that I want to offset in its plane.
Code: Select all
Pick distance ToDo.doTasks, Unexpected error: <class 'AttributeError'> in ['Draft.offset(FreeCAD.ActiveDocument.Section,FreeCAD.Vector(-0.79842002489893, -0.4493481558184617, 0.40076389396119433),copy=True,occ=False)', 'FreeCAD.ActiveDocument.recompute()']
here a somewhat improved version, with some more error-checking. I can understand that it is not very useful outside the very specific use-case as described. With the icon.Zolko wrote: ↑Mon Apr 27, 2020 6:21 pmI've made a very specific tool that I really needed and couldn't find in the Curves workbench: it allows to offset 3D curves that are planar, in their own plane. The very specific use-case is to make ribs in aircraft wings. The resulting curve can be either a 3D wire (Part.line) or a sketch. It is not perfect, it's quite brute-force, but should be good enough for many people. It can't handle curves, only poly-lines.
Windows 7 (64) + FreeCAD 0.18Chris_G wrote: ↑Tue Dec 12, 2017 2:43 pmHi,
The goal of this tool is to create a support face ( for a sketch object ) that stays clamped to 2 rail curves.
Let's say I want to create a parametric arched-top guitar shape between the white and orange Sketcher curves :
- I go Top-View (View Direction is used as the direction of the support face) and I select the 2 rail curves, by clicking them where I want the Support face to be
- I activate the tool and I get this support face that is parametric and can be moved along the input curves with the Parameters properties :
- Now, I can use the top edge of the support face as an external geometry line in a sketch, and constraint my BSpline curve ends to this line.
- Finally, I can build a surface with the boundary curves and the profile sketches as "unbound edge" constraint curves.
This surface is fully parametric and can be stretched and modified by editing the sketches.
For the "BSpline curve" tool ???hammax wrote: ↑Tue Dec 12, 2017 2:00 pmNext question: is there a possibility to change fontsize and fontcolour in your Info-HUD-Feature.
I already could change it per hack inside 1.Icon-Tool (Bspline) .py-Macro.
In HUD there are at least two places, where fontproperties are defined. But here my hack-trials didn't succeed.
( I need a bigger font and a bright colour , because I have a darkblue Background, like Catia)
This tool is fairly broken, I should remove it.
But you can modify the appearance of the HUD on line 54 of "bezierCurve.py" :
Code: Select all
self.Block1.setFont("Sans", 10.0, (0.,0.,0.)) #Function arguments are (FontName, Size, Color)