Using FreeCAD Daily from the macro completed in 15.489059448242188 seconds but using today's compiled build it completes in 555.14466547966 seconds. That's not exactly a subtle worsening in performance but I hope this constructive feedback will be of use.
Old FreeCAD Daily Build:
OS: Linux Mint 19.3 (X-Cinnamon/cinnamon)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.
Build type: Release
Branch: unknown
Hash: 08854bcc717b89fe437b671edc2098c603ff5dec
Python version: 3.6.9
Qt version: 5.9.5
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/UnitedKingdom (en_GB)
This morning's compiled build:
OS: Linux Mint 19.3 (X-Cinnamon/cinnamon)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.23491 (Git)
Build type: Unknown
Branch: master
Hash: 04337034ce0aeff5434d3930cad0db2fb3d2aa36
Python version: 3.6.9
Qt version: 5.9.5
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/UnitedKingdom (en_GB)
Code: Select all
import time
start_time = time.time()
LargeRadius = 560.0
SmallRadius = 20.0
nbPas = 480
excentrique = 12.0
EpiCycloidAngle = 0.0
# Large line length= sum of the radiuses
ActiveSketch.addGeometry(Part.LineSegment(App.Vector(10,23,0),App.Vector(27.354679,55.016010,0)),False)
ActiveSketch.addConstraint(Sketcher.Constraint('Coincident',0,1,-1,1))
c=ActiveSketch.addConstraint(Sketcher.Constraint('Distance',0,LargeRadius+SmallRadius))
ActiveSketch.setVirtualSpace(c, True)
La=ActiveSketch.addConstraint(Sketcher.Constraint('Angle',-1,1,0,1,2*3.141592653589793*EpiCycloidAngle/360.0))
ActiveSketch.setVirtualSpace(La, True)
#ActiveSketch.setDatum(La,App.Units.Quantity('0.000000 deg'))
# arc de cercle small radius
ActiveSketch.addGeometry(Part.ArcOfCircle(Part.Circle(App.Vector(25,31,0),App.Vector(0,0,1),12),-2,0.4),False)
c=ActiveSketch.addConstraint(Sketcher.Constraint('PointOnObject',1,1,0)) # start of the Arc on the large line
ActiveSketch.setVirtualSpace(c, True)
ActiveSketch.addConstraint(Sketcher.Constraint('Coincident',1,3,0,2)) #center at end of the large line
c=ActiveSketch.addConstraint(Sketcher.Constraint('Radius',1,SmallRadius))
ActiveSketch.setVirtualSpace(c, True)
# Small line
ActiveSketch.addGeometry(Part.LineSegment(App.Vector(26,35,0),App.Vector(34,38,0)),False)
ActiveSketch.addConstraint(Sketcher.Constraint('Coincident',0,2,2,1)) #start at the end of the large line
c=ActiveSketch.addConstraint(Sketcher.Constraint('Distance',2,excentrique))
ActiveSketch.setVirtualSpace(c, True)
c=App.ActiveDocument.Sketch.addConstraint(Sketcher.Constraint('PointOnObject',1,2,2))
ActiveSketch.setVirtualSpace(c, True)
Sa=ActiveSketch.addConstraint(Sketcher.Constraint('Angle',0,2,2,1,0)) #creer contrainte a 0 (radian))
ActiveSketch.setVirtualSpace(Sa, True) # make the angle constraint invisible to improve drawing understanding
n=0
Sv= ActiveSketch.Geometry[2].EndPoint
Lad = (360.000000/nbPas)
Sad = Lad * (LargeRadius/SmallRadius)
if True:
while n < nbPas :
n += 1
App.ActiveDocument.Sketch.setDatum(La,App.Units.Quantity(str(Lad*n+EpiCycloidAngle) + ' deg'))
App.ActiveDocument.Sketch.setDatum(Sa,App.Units.Quantity(str(Sad*n) + ' deg'))
Ev= App.ActiveDocument.Sketch.Geometry[2].EndPoint
App.ActiveDocument.Sketch.addGeometry(Part.LineSegment(Sv,Ev),False)
Sv=Ev
#clean up of the geometries used to buid the epicycloid
App.ActiveDocument.Sketch.delGeometry(2)
App.ActiveDocument.Sketch.delGeometry(1)
App.ActiveDocument.Sketch.delGeometry(0)
print("--- %s seconds ---" % (time.time() - start_time))