Draw a Circle With Patches Netlogo
NetLogo User Community Models
(back to the NetLogo User Community Models)
Download If clicking does not initiate a download, try correct clicking or control clicking and choosing "Relieve" or "Download".(The run link is disabled for this model because it was fabricated in a version prior to NetLogo 6.0, which NetLogo Web requires.) |
WHAT IS IT?
A cartoon tool for NetLogo, implemented in NetLogo.
Information technology can be used to blueprint initial patch color arrangements.
It includes the usual tools--brush, line, circumvolve-- and a multi-level disengage / redo feature.
Basic save and load features allow color setups to be saved for utilize in other models.
HOW IT WORKS
Click drawing-tool ON to begin. If needed, the model automatically "resets".
Choose a tool and effect from the option-lists.
Choose a brush width and brush-color.
Click in the patch surface area to draw.
Castor-WIDTH
Utilize to set the brush-width used by the tools.
Is always odd, as it uses integer patches
Brush
Sets the color of the brush, in increments of .0001
STRENGTH - CYCLES
strength: controls the "strength" of various effects.
blend: stronger ways less transparent
dapple: stronger means a wider range of shades
diffuse: stonger diffuses more
use for any control or effect that requires a value varying from 0.0 to one.0
cycle: diffuse: repeats the lengthened function that many times
startburst: sets the gap betwixt the lines
THE Color PALETTE
Brush: Sets the brush color anywhere from 0.000 to 139.999
Buttons: Sets the brush to the named color.
Lighter,
Darker: Affect the brush colour (past even 0.5 increments)
Pure: Sets the castor color to the "pure" colour, aka the middle color.
Example: If brush is 19.455 (lite red),
changes it to 15.000 (cerise)
Notation: Pure uses the Heart function, and then darker grays go black,
and brighter grays become white.
_0.0000: Sets the brush to the darkest shade of the current colour.
Case: If brush is 117.500 (lighter violet),
changes color to 110.000 (darkest violet).
_9.9999: Sets the brush to the lightest shade of the current colour
THE TOOLS
Tools change the canvas in different ways, using the current brush colour and / or event. (Except for pick-color, which just changes the brush color)
To cancel a line, frame, box, circle or ring in progress, click RESET.
brush: click and drag to paint
lines: click to set up the commencement betoken, click again to complete the line.
frames: click to draw a rectangle outline, every bit thick as the castor-width
boxes: click to draw a filled rectangle
fill: click to fill the selected solid-color region
fill-shades: similar make full, but ignores shades of colour.
doesn't work for all effects.
circles: draws a filled circle. click to specify center,
again to specify radius
rings: like circles, but draws a circular ring.
pick-color: click on the canvas to change the brush colour to the
color of the selected patch
modify-colour: click on the canvas to change every patch with that color to the brush colour
THE EFFECTS
solid: draws in the selected color
dappled: draws in random shades of the selected color
center: changes the current patch color to the pure shade of that colour,
except for grays, where darker grey becomes black and lighter gray becomes white
undapple: changes the current patch color to the pure shade of that color
darken: changes the electric current patch color to be slightly darker
lighten: changes the current patch color to be slightly lighter
alloy: draws in the slected colour, blended with the electric current patch colour.
fix the opacity with the strength slider.
SAVING AND LOADING
Salve : Save the patch colors (prompt for name)
Load : Load the patch colors (prompt for name)
Load!: Load the same file loaded last time (no prompt)
Enter the file-proper noun (or path and file-name) when prompted.
If you desire to use a file-extension, be certain to include it.
If the loaded image is larger than the current screen, you will exist warned, the image volition load, and the edges will be cut off.
If the loaded prototype is smaller, it will load into the middle. The outer edges will not be cleared or otherwise inverse.
Boosted TOOLS / EFFECTS / CONTROLS
reset: resets the drawing cursor and any marking turtles.
use to abolish a line, frame, box, circle, or ring in progress.
clear-cursors: clears the drawing cursor from the canvas,
then the canvas is clean for screen-shots and the like.
strength: specifies the diffusion strength, or the blend opacity
(stronger is more opaque)
SHIFTERS
~~~~~~~~
shifters: shifts the patch colors in the indicated management, by the amount of the shift slider
flip <-->: Flips the world forth the heart vertical axis
flip /\\/: Flips the globe along the centre horizontal axis
rotate: rotates the patches 90 degrees.
Caution: if the world is not square, colour data in patches outside the center will exist lost
UNDO
~~~~
disengage-on?: enables or disables the undo characteristic
undo: removes the concluding change. For the brush tool, each stroke can be united nations-done individually
redo: reapplies the changes removed by undo.
articulate-undo: deletes the undo-history
undo-levels: sets the maximum number of changes that can be recorded. Additional changes will crusade the older
SPECIAL Issue BUTTONS
~~~~~~~~~~~~~~~~~~~~~~
sample-solid: flashes the castor color on the canvas
sample-blend: flashes the brush color blended with the canvas
sheet: sets the canvas color
<=brush: sets the canvas color from the brush color
dapple-all: sets all patches to a random shade of their current color
latitude of shades adamant past strength
0.0 = use pure color
0.five = utilize mostly middle shades
1.0 = apply all shades
posterize: sets all patches to their pure color.
shade-edges: sets color brightness based on number
of neighbors with same base of operations-color
diffuse: performs improvidence at the specified strength
for the specified number of cycles
starburst: draws a sweep of lines effectually the center, in the current castor colour and width,
cycles sets the spacing of the lines. Used with alloy, darken, or lighten,
produces some attractive furnishings.
SPECIAL PROGRAMMING NOTES
To interactively show the user the line, circle or box that will be drawn, "mark" turtles are created and destroyed. The number of marking turtles varies, depending on the screen-size.
To reduce the number of global variables, the model makes use of turtle variables and turtle inheritance.
The flood fill functions utilise recursion to fill the patches.
The model makes use of a turtle's ability to directly access the variables of the patch the turtle is on: The pointer turtle performs most of the tasks, so it tin can directly refer to the patch colour, etc.
The model uses several custom-designed turtle-shapes as the diverse cartoon cursors.
Where in that location are 2 reporters with virtually the same name, like "blend" and "alloy?" the unadorned reporter refers to the castor color, whereas the "?" reporter ever requires a colour argument. For case: "dappled" reports a random shade of the brush color, just "dappled? red" reports a random shade of scarlet.
Many of the effects depend on the base-color and tint reporters.
Base-color gives the blackness version of the color (i.e. the even multiple of 10 for the color)
Eastward.yard. the base-color of red (15) is 10.
Tint could also be called "shade": it gives the amount higher up the base of operations-color. The tint of a pure color is alway 5. The tint of black is 0, the tint of white is nine.9999.
Blackness, white and gray are foreign cases. They all share a base of operations color (0) and therefore, the pure color (base + 5) of all iii is five. Then, undapple will always turn blackness and white to gray. However, Center is a smarter undapple: Information technology examines the shade of gray and turns darker gray to black and lighter greyness to white.
Setting the size and shape every cycle caused the turtles to flicker. To avert flicker of the cursors, the size and shape is tested commencement, and only fix if it doesn't friction match. Likewise, the x and y coordinates are set only if the mouse moves to a different patch.
Source: http://ccl.northwestern.edu/netlogo/models/community/drawing-tool
0 Response to "Draw a Circle With Patches Netlogo"
Post a Comment