The Trunk: Balloon-ul.30.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: Balloon-ul.30.mcz

commits-2
Levente Uzonyi uploaded a new version of Balloon to project The Trunk:
http://source.squeak.org/trunk/Balloon-ul.30.mcz

==================== Summary ====================

Name: Balloon-ul.30
Author: ul
Time: 24 April 2017, 1:00:18.796732 pm
UUID: 15ea6361-1ff2-41af-bde1-171dc7c83dd4
Ancestors: Balloon-ul.29

- rewrote senders of #clone to use #shallowCopy

=============== Diff against Balloon-ul.29 ===============

Item was changed:
  ----- Method: BalloonBezierSimulation>>computeSplitAt: (in category 'computing') -----
  computeSplitAt: t
  "Split the receiver at the parametric value t"
  | left right newVia1 newVia2 newPoint |
+ left := self shallowCopy.
+ right := self shallowCopy.
- left := self clone.
- right := self clone.
  "Compute new intermediate points"
  newVia1 := (via - start) * t + start.
  newVia2 := (end - via) * t + via.
  "Compute new point on curve"
  newPoint := ((newVia1 - newVia2) * t + newVia2) asIntegerPoint.
  left via: newVia1 asIntegerPoint.
  left end: newPoint.
  right start: newPoint.
  right via: newVia2 asIntegerPoint.
  ^Array with: left with: right!

Item was changed:
  ----- Method: Bezier2Segment>>curveFrom:to: (in category 'vector functions') -----
  curveFrom: param1 to: param2
  "Return a new curve from param1 to param2"
  | newStart newEnd newVia tan1 tan2 d1 d2 |
  tan1 := via - start.
  tan2 := end - via.
  param1 <= 0.0 ifTrue:[
  newStart := start.
  ] ifFalse:[
  d1 := tan1 * param1 + start.
  d2 := tan2 * param1 + via.
  newStart := (d2 - d1) * param1 + d1
  ].
  param2 >= 1.0 ifTrue:[
  newEnd := end.
  ] ifFalse:[
  d1 := tan1 * param2 + start.
  d2 := tan2 * param2 + via.
  newEnd := (d2 - d1) * param2 + d1.
  ].
  tan2 := (tan2 - tan1 * param1 + tan1) * (param2 - param1).
  newVia := newStart + tan2.
+ ^self shallowCopy from: newStart to: newEnd via: newVia.!
- ^self clone from: newStart to: newEnd via: newVia.!

Item was changed:
  ----- Method: LineSegment>>curveFrom:to: (in category 'vector functions') -----
  curveFrom: parameter1 to: parameter2
  "Create a new segment like the receiver but starting/ending at the given parametric values"
  | delta |
  delta := end - start.
+ ^self shallowCopy from: delta * parameter1 + start to: delta * parameter2 + start!
- ^self clone from: delta * parameter1 + start to: delta * parameter2 + start!