ScratchData LogoScratchData
Back to chooper-beta's profile

Bézier Curve (Optimised)

CHchooper-beta•Created August 18, 2015
Bézier Curve (Optimised)
7
5
78 views
View on Scratch

Instructions

Click on the stage to add points Drag points around to move them You may need to click the green flag twice

Description

In the original version by @ScratchinJoJo, to get around not being able to pass lists as parameters, we generate a 'points-csv' for each iteration (loop). This is effectively a long piece of text containing all the x and y positions of the points. However, this method has the disadvantage of requiring the csv to be parsed - a process of splitting the text back into a list. This is inefficient and should be avoided when possible. In this version, I have removed the need for building and parsing the csv by always storing the values in lists - not text. Although we do need to still build these lists, we do not need to parse them meaning that we can significantly improve performance. To further improve performance I deleted the 'middlePoints' list and replaced it with the 'allPoints' list, which now contains the x and y positions of all the points in the Bezier as opposed to only the middle ones.

Project Details

Project ID73388190
CreatedAugust 18, 2015
Last ModifiedAugust 19, 2015
SharedAugust 18, 2015
Visibilityvisible
CommentsAllowed

Remix Information

Parent ProjectView Parent
Root ProjectView Root