Part.Loft - Wrong Vertices Linked?

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
User avatar
wandererfan
Posts: 3974
Joined: Tue Nov 06, 2012 5:42 pm

Part.Loft - Wrong Vertices Linked?

Postby wandererfan » Sat Apr 05, 2014 12:17 pm

In a Part.Loft, is there a way to control which vertex on profile p gets linked to which vertex on profile p+1?

In SimpleLoft, v1p1 links to v2p2, v3p1 links to v4p2, etc, so the Loft is not very useful. In SnakeLoft, v1p1 links to v1p2, v2p1 links to v2p2, etc and the Loft is sensible.

Is there something in how the profiles are created that controls this? Something in the angle/cuvature of the loft lines?

AAA,
wf
RubbishLoft.png
RubbishLoft.png (10.44 KiB) Viewed 4402 times
OS: Ubuntu 12.04.4 LTS
Platform: 64-bit
Version: 0.14.3379 (Git)
Branch: master
Hash: 2d724365cfb82048e7ebf3346fabfe904549e598
Python version: 2.7.3
Qt version: 4.8.1
Coin version: 3.1.3
SoQt version: 1.5.0
OCC version: 6.7.0
Attachments
SnakeLoft.fcstd
Loft with sensible vertex choices
(6.73 KiB) Downloaded 39 times
SimpleLoft.fcstd
Loft with rubbish vertex choices
(9.04 KiB) Downloaded 43 times
User avatar
quick61
Posts: 3803
Joined: Sat Aug 24, 2013 2:49 am
Location: u.S.A.

Re: Part.Loft - Wrong Vertices Linked?

Postby quick61 » Sat Apr 05, 2014 1:51 pm

What I have found is anything past half way/45* will cause it to flip. This shows up when rotating the sketches in a straight line as well. You can see this by drawing 2 square sketches at some distance apart, say 50, and loft between them. rotate one sketch 44* and note the direction of the twist. Now change the rotation to 46* and you will see the direction of the twist flip.

What is needed is a way to pick which points loft where, kind of like an alignment type tool. This came up before in the process of lofting a twisted star pattern ring if I'm remembering correctly. If I find the thread, I'll post back.

Mark

EDIT - Found it, it was in the "how can i draw something like this?" thread.
This post made with 0.0% Micro$oft products - GOT LINUX?
jmaustpc
Posts: 9680
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: Part.Loft - Wrong Vertices Linked?

Postby jmaustpc » Sat Apr 05, 2014 2:17 pm

Hi WF
I get the problem with this version of 0.14dev but not with 0.13

OS: Ubuntu 12.04.4 LTS
Platform: 64-bit
Version: 0.14.3386 (Git)
Branch: master
Hash: f2a922bdf2125a94a6f7a8ec96474f5183097cff
Python version: 2.7.3
Qt version: 4.8.2
Coin version: 3.1.3
SoQt version: 1.5.0
OCC version: 6.7.0



If I force a recompute by toggling Ruled parameter, 0.14dev above gives the error icon in treeview when in ruled true. However 0.13 below works in both modes.

OS: Ubuntu 12.04.4 LTS
Platform: 64-bit
Version: 0.13.1830 (Git)
Branch: releases/FreeCAD-0-13
Hash: ec7636d7aaf2612e9b43cff5d6a424037d53e505
Python version: 2.7.3
Qt version: 4.8.2
Coin version: 3.1.3
SoQt version: 1.5.0
OCC version: 6.5.0

loft_is_ruled_0_13.jpeg
loft_is_ruled_0_13.jpeg (64.23 KiB) Viewed 4395 times
loft_not_ruled_0_13.jpeg
loft_not_ruled_0_13.jpeg (63.38 KiB) Viewed 4395 times
It might be an OCC issue because it works properly after a recompute in this version as well.

OS: Ubuntu 12.04.4 LTS
Platform: 64-bit
Version: 0.14.3236 (Git)
Branch: master
Hash: 629d5cc1fe193c88d1dfefccd000bfc7cd6f9fc0
Python version: 2.7.3
Qt version: 4.8.2
Coin version: 3.1.3
SoQt version: 1.5.0
OCC version: 6.5.0

I am going to recompile that last version to test if it is OCC or the last few commits of FreeCAD 0.14dev that vary between the two.

I'll post back with the result in a few minutes...but I am betting this is an OCC bug. :)

Jim
jmaustpc
Posts: 9680
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: Part.Loft - Wrong Vertices Linked?

Postby jmaustpc » Sat Apr 05, 2014 2:42 pm

OK, guys I can confirm that this seems to be OCC version related....either there is a bug or there has been some change or other that we need to account for.

OS: Ubuntu 12.04.4 LTS
Platform: 64-bit
Version: 0.14.3389 (Git)
Branch: master
Hash: a1e049bc8a687c52d82baa6e96d2f31d2a3f5862
Python version: 2.7.3
Qt version: 4.8.2
Coin version: 3.1.3
SoQt version: 1.5.0
OCC version: 6.5.0


This latest FreeCAD compiled against the old OCC 6.5.0 from default Ubuntu 12.04, works perfectly after a recompute is forced.

Jim
User avatar
wandererfan
Posts: 3974
Joined: Tue Nov 06, 2012 5:42 pm

Re: Part.Loft - Wrong Vertices Linked?

Postby wandererfan » Sat Apr 05, 2014 8:25 pm

jmaustpc wrote:If I force a recompute by toggling Ruled parameter, 0.14dev above gives the error icon in treeview when in ruled true. However 0.13 below works in both modes
I think the error icon is the equivalent of this in the Gui:
InputError.png
InputError.png (45.18 KiB) Viewed 4387 times
but I don't know what would be the objection to having both boxes ticked.
quick61 wrote:What is needed is a way to pick which points loft where, kind of like an alignment type tool. This came up before in the process of lofting a twisted star pattern ring if I'm remembering correctly. If I find the thread, I'll post back.
Agreed, but there is nothing obvious in the calls to OCC (BRepOffsetAPI_ThruSections) that would govern this. I'll keep digging. There are also other OCC calls that can be used to make a loft-like object. I'll look into that too. Maybe we'll need 2 functions (linear/curved lofts??) or an extra parameter.

wf
User avatar
wandererfan
Posts: 3974
Joined: Tue Nov 06, 2012 5:42 pm

Re: Part.Loft - Wrong Vertices Linked?

Postby wandererfan » Tue Apr 08, 2014 12:33 am

We make progress slowly. BetterLoft.png uses the same profiles and options as RubbishLoft.png above.
BetterLoft.png
BetterLoft.png (6.27 KiB) Viewed 4365 times
More to come.

WF

OS: Ubuntu 12.04.4 LTS
Platform: 64-bit
Version: 0.14.3386 (Git)
Branch: CircleLoft
Hash: f2a922bdf2125a94a6f7a8ec96474f5183097cff
Python version: 2.7.3
Qt version: 4.8.1
Coin version: 3.1.3
SoQt version: 1.5.0
OCC version: 6.7.0
triplus
Posts: 9464
Joined: Mon Dec 12, 2011 4:45 pm

Re: Part.Loft - Wrong Vertices Linked?

Postby triplus » Tue Apr 08, 2014 1:03 am

Yes i would say Loft tool would need to get possibility to control the flow and "auto open/close" similar as Ruled Surface tool did:

viewtopic.php?f=3&t=6127&p=49224#p48969

ATM if you are in luck you will get wanted result. If not you have to find a workaround.
jmaustpc
Posts: 9680
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: Part.Loft - Wrong Vertices Linked?

Postby jmaustpc » Tue Apr 08, 2014 8:52 am

Hi WF
wandererfan wrote:but I don't know what would be the objection to having both boxes ticked.
I know the answer to that because I thought the same thing and ask Werner about it when he first made the tool. :)

What it is, is a toggle between the type of surface to be produced either being Ruled or not, regardless of the Loft's producing a solid or a surface. For anyone who does not know, a Ruled Surface is a geometric principle, it is a surface that can be described but straight lines, if you don't know what I am talking about, have a look on wikipedia, it has a great article, search "ruled surface".

So Loft can produce a solid whose sub-component surface is either a ruled or not ruled, surface. Loft can also produce a surface only, that is not a solid, but that surface can still be either a ruled surface or not ruled surface.


My testing of the latest FreeCAD 0.14dev code both compiled against occ6.5.0 and the same FreeCAD code compiled against OCC6.7.0 (OCE0.16) shows that the "twisted issue" you found in Loft only happens with the later OCC.

Jim
wmayer
Site Admin
Posts: 15956
Joined: Thu Feb 19, 2009 10:32 am

Re: Part.Loft - Wrong Vertices Linked?

Postby wmayer » Tue Apr 08, 2014 9:14 am

In a Part.Loft, is there a way to control which vertex on profile p gets linked to which vertex on profile p+1?
The reason for the failure has to do with the placement applied on the sketches because I assume the internal orientation of the shapes doesn't fit to what the loft needs. All three sketches have totally different rotation axes and this might be the major problem.

As a quick test I copied the sketches into a new document and reset the placements. Then for sketch two I set rotation axis=(0,1,0) angle=90 deg and for sketch three the same axis and angle=180 deg. So, this gives the same form (but in a different position of course) and the the loft works as expected.
triplus
Posts: 9464
Joined: Mon Dec 12, 2011 4:45 pm

Re: Part.Loft - Wrong Vertices Linked?

Postby triplus » Tue Apr 08, 2014 6:43 pm

I see it comes down to sketch rotation/placement? I assumed something like that when trying out different thing in this thread:

viewtopic.php?f=3&t=6127

But could not pin point "solution". Could this be solved only by rotating sketch around one of the axis or does the sketch itself needs to be moved (location) too?