[Solved] Bug #2092: shape formed from makeCircle + makeOffset cannot be used to a solid by "makeLoft "

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

[Solved] Bug #2092: shape formed from makeCircle + makeOffset cannot be used to a solid by "makeLoft "

Post by Kunda1 »

issue #2092: shape formed from makeCircle + makeOffset cannot be used to a solid by "makeLoft "

Description
When use the shape of "makeCircle" as one end of "makeLoft", and "makeOffset" this shape as the other end, the created object is only two separated faces instead of a solid. While the shape from "makePlane" or "makeLine" can get correct result.

Steps To Reproduce
1. coding:

Code: Select all

origin = Base.Vector(0,0,0)
myVec = Base.Vector(0,0,10)
myAng = 80
myMat = Base.Matrix()
myMat.move(myVec)

edge1= Part.makeCircle(5,origin)
wire1 = Part.Wire(edge1)
wire2 = wire1.makeOffset(-3)
wire2 = wire2.transformGeometry(myMat)
solid1 = Part.makeLoft([wire1,wire2],True)

edge3= Part.makePlane(10,10)
wire3 = edge1.Wire
wire4 = wire3.makeOffset(-3)
wire4 = wire4.transformGeometry(myMat)
solid2 = Part.makeLoft([wire3,wire4],True)

Part.show(solid1)
Part.show(solid2)
2. You can see "solid1" is abnormal.
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
User avatar
NormandC
Veteran
Posts: 18587
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: Bug #2092: shape formed from makeCircle + makeOffset cannot be used to a solid by "makeLoft "

Post by NormandC »

The script is not complete and produces error after error.

I had to add

Code: Select all

import Part
from FreeCAD import Base
Next I got this error:

Traceback (most recent call last):
File "/home/normand/Macros_FreeCAD/test.FCMacro", line 16, in <module>
wire3 = edge1.Wire
<type 'exceptions.AttributeError'>: 'Part.Edge' object has no attribute 'Wire'


This is extremely annoying. If bug reporters can't be bothered to provide a fully functional script I would close the report as invalid. :roll:
wmayer
Founder
Posts: 20243
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Bug #2092: shape formed from makeCircle + makeOffset cannot be used to a solid by "makeLoft "

Post by wmayer »

I assume the script should be:

Code: Select all

import Part
from FreeCAD import Base

origin = Base.Vector(0,0,0)
myVec = Base.Vector(0,0,10)
myAng = 80
myMat = Base.Matrix()
myMat.move(myVec)

edge1= Part.makeCircle(5,origin)
wire1 = Part.Wire(edge1)
wire2 = wire1.makeOffset(-3)
wire2 = wire2.transformGeometry(myMat)
solid1 = Part.makeLoft([wire1,wire2],True)

face1= Part.makePlane(10,10)
wire3 = face1.OuterWire
wire4 = wire3.makeOffset(-3)
wire4 = wire4.transformGeometry(myMat)
solid2 = Part.makeLoft([wire3,wire4],True)

Part.show(solid1)
Part.show(solid2)
However, when showing the results everything looks normal and also the shape types are solid. So, I can't see anything wrong there. Maybe it was an issue with a former OCC version.

EDIT:
Yes, with the below version the output is wrong
OS: Windows 7
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.16.6706 (Git)
Build type: Release
Branch: releases/FreeCAD-0-16
Hash: f86a4e411ff7848dea98d7242f43b7774bee8fa0
Python version: 2.7.8
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 6.8.0.oce-0.17
but it works with:
OS: Windows 7
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.9771 (Git)
Build type: Release
Branch: master
Hash: 27c4136f58f5911f2048b7f70f62ec0430115d99
Python version: 2.7.8
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.0.0
Post Reply