View Issue Details

IDProjectCategoryView StatusLast Update
0002199FreeCADBugpublic2016-02-28 22:29
Reportermore11 Assigned Toyorik  
PrioritynormalSeveritycrashReproducibilityalways
Status closedResolutionfixed 
PlatformDell XPSOSWindows 7OS Versionx64
Summary0002199: Cannot make offset of bspline
DescriptionException when trying to make offset of bspline.

Traceback (most recent call last):
  File "C:/Users/more10.HOLISTICODE/Dropbox/Public/FreeCAD/offset/offset.FCMacro", line 6, in <module>
    Draft.offset(FreeCAD.ActiveDocument.BSpline,FreeCAD.Vector(9.99994707264,-0.0325352790956,0.0),copy=True,occ=False)
  File "C:\Users\more10.HOLISTICODE\Downloads\FreeCAD_0.16.5231_x64_dev_bin\Mod\Draft\Draft.py", line 1567, in offset
    newobj = makeBSpline(delta)
  File "C:\Users\more10.HOLISTICODE\Downloads\FreeCAD_0.16.5231_x64_dev_bin\Mod\Draft\Draft.py", line 856, in makeBSpline
    for v in pointslist.Vertexes:
<type 'exceptions.AttributeError'>: 'Base.Vector' object has no attribute 'Vertexes'
Steps To ReproduceOpen file https://dl.dropboxusercontent.com/u/106944188/FreeCAD/offset/bspline.FCStd

Run macro https://dl.dropboxusercontent.com/u/106944188/FreeCAD/offset/offset.FCMacro

Additional InformationPreview looks good.
TagsNo tags attached.
FreeCAD Information

Activities

yorik

2015-08-05 02:20

administrator   ~0006270

works for me... I can offset this bspline normally

wmayer

2016-02-28 18:13

administrator  

bspline.FCStd (Attachment missing)

wmayer

2016-02-28 18:14

administrator  

offset.FCMacro (Attachment missing)

wmayer

2016-02-28 18:16

administrator   ~0006854

When I ran the script then I get this error:

Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "c:\Projects\FreeCAD-git\x64\Mod\Draft\Draft.py", line 1569, in offset
    newobj = makeBSpline(delta)
  File "c:\Projects\FreeCAD-git\x64\Mod\Draft\Draft.py", line 846, in makeBSpline
    for v in pointslist.Vertexes:
AttributeError: 'Base.Vector' object has no attribute 'Vertexes'

When I set "copy" argument to False then the code works but when re-computing the shape I get:
Traceback (most recent call last):
  File "c:\Projects\FreeCAD-git\x64\Mod\Draft\Draft.py", line 4610, in execute
    spline.interpolate(obj.Points, False)
<class 'Part.OCCError'>: not enough points given

more11

2016-02-28 18:50

reporter   ~0006856

It 6 months old. The API has probabaly changed since I reported it. Just close it.

yorik

2016-02-28 22:28

administrator   ~0006860

The problem here is that when offsetting a Draft bspline, the offset function needs a list of vectors (one for each node) instead of just one vector. This is indeed not mentioned in the docstring, I'm updating it now to make this clearer.

Related Changesets

FreeCAD: master 5bdbe2db

2016-02-28 23:28:35

yorik

Details Diff
Draft: better docstring for offset - fixes 0002199 Affected Issues
0002199
mod - src/Mod/Draft/Draft.py Diff File

Issue History

Date Modified Username Field Change
2015-07-25 09:57 more11 New Issue
2015-08-05 02:20 yorik Note Added: 0006270
2015-08-05 02:23 yorik Status new => feedback
2016-02-28 18:13 wmayer File Added: bspline.FCStd
2016-02-28 18:14 wmayer File Added: offset.FCMacro
2016-02-28 18:16 wmayer Note Added: 0006854
2016-02-28 18:50 more11 Note Added: 0006856
2016-02-28 18:50 more11 Status feedback => new
2016-02-28 22:28 yorik Note Added: 0006860
2016-02-28 22:29 yorik Changeset attached => FreeCAD Master master 5bdbe2db
2016-02-28 22:29 yorik Assigned To => yorik
2016-02-28 22:29 yorik Status new => closed
2016-02-28 22:29 yorik Resolution open => fixed