9716

Draw Polygons on Grids

You can create, drag, store and delete points, lines, polylines and polygons.
All vertices (of the currently edited polygon) now have locators associated, so you can drag them and place them separately with the mouse. Also, you can create and delete a vertex with a single mouseclick.
A host of options is provided (see details text).

SNAPSHOTS

  • [Snapshot]
  • [Snapshot]
  • [Snapshot]

DETAILS

Introduction
In this demonstration you create polylines and polygons, both of which we will call "objects" in the following text.
The current object is highlighted by having one (the current) vertex colored red and the other vertices colored orange.
If you do not see which object is the current, then the point size is zero or close to it. Move the point size slider to the right to highlight the vertices of the current object.
Controls
Grid controls
"Show" will display a point grid. This grid will be "ortho" (orthogonal) or isometric (30° grid).
With "grid spacing" you can change the density of the grid points.
"Snap to grid/closest vertex/object": Vertices are NOT automatically snapped.
Click "grid" or "closest vertex" to snap the current red vertex to the grid or to the closest vertex outside the current object, and this includes the pivot (special position on the board marked by a blue dot)!
Click "object" to snap all vertices of the current object to the grid.
"axes"
Displays a pair of axes which fits best with grid spacing "1".
Global polygon controls
Here you select an "outline" (for all polygons simultaneously), "opacity" (only as a global control), and line thickness (for all your polylines simultaneously).
Controls for polyline/polygon
"object" pop-up menu
Here you can choose which object you want to edit. If you do not know which object number to select, click option "object" in the "number" setter bar (see further down). This will display the sequence numbers of the objects at the centers of the objects.
There is also a pair of buttons "<,>" to select the previous or the next object in the sequence.
"polyline (or polygon)"
Select it to make the current object a polyline. Otherwise it will be a polygon.
"drag object" mode
Click to go into "drag object" mode, i.e. you can move your polygon or polyline as a whole (not just one vertex). To drag your object, you have to move the mouse cursor to the red vertex first.
Warning: It is not recommended to do anything else during drag mode! Otherwise the system might not react as expected.
Click again to stop the drag mode.
"highlight current object"
When active, the current object's vertices will be highlighted in red (last vertex) and orange (all others).
"line and face color"
Select a color for the face of the current polygon. The same color is used for the colored lines of the polylines.
"point size" slider
Controls the point size of the current polygon.
"all" button
Causes the application of the current pointsize to all stored objects.
"numbers -/vertices/objects" setter bar
Displays the sequence numbers of the vertices of the current object or the sequence numbers of the objects.
"move to top"
Click to make the current object the top one.
"shift" setter bar
Shift the current object to the left, right, up or down by one unit.
"action"
This menu offers processes concerning snaps, mirroring, coloring and the pivot.
Snap options: Select to snap all vertices of the current object or of all objects to the grid.
Mirroring options: You can mirror an object:
- at the x-axis, the y-axis, at the origin, at the pivot, horizontally at the pivot, vertically at the pivot,
- at the red vertex, horizontally at the red vertex, vertically at the red vertex,
- or at the edge which leads to the red vertex (edge between vertex number v-1 and vertex number v).
Coloring options: Choose to paint all polygons with the current color, or randomize the color of the current object or of all objects.
Option "hide pivot" allows you to make the pivot invisible. Click again to show it again.
Option "object to pivot" moves the current object such that the red vertex ends up at the pivot.
Object "pivot -> vertex" moves the pivot to the red vertex of the current object.
"project/object" and "save/restore/dupl/del" setterbars
Click "project" or "object" depending whether you plan to save/restore/duplicate/delete your whole project or only the current polygon.
"rotate"
Select the degrees for a rotation of the current object.
"+/-/o"
Click to rotate the current object anticlockwise ("+"), clockwise ("-"), or create a circular arrangement of copies.
The rotations will be around a given pivot (which is at the origin at first).
"set pivot" mode
Click it to move temporarily into a special mode that allows you to mark (by the mouse dragging the blue locator) a special spot (the pivot).
Warning: No other actions should be tried during this mode. Otherwise the system might not react as expected.
Click again to exit the "set pivot" mode.
"snap"
Click to snap the pivot to the grid (only available when "set pivot" mode is NOT active).
"red vertex" pop-up menu
Here you can choose which vertex you want to edit (see "click board to" - option "move vertex"). This vertex will be colored red.
Note, however, that a newly added vertex will always be connected to the vertex with the highest number, independent of which vertex is red.
There is also a pair of buttons "prev/next" to select the previous or the next vertex in the sequence.
"shift" setter bar
Click to shift the red vertex to the left, right, up or down by one unit.
"delete"
Click to delete the red vetex. You can also delete (and create) a vertex with Alt-Click in Windows or Option-Click on the Mac.
"vertex only"
Click to reduce the current object to one point.
This tool can be used to start a new polygon (click "object duplicate" first)
How to create or delete a vertex
At the bottom left a hint is displayed that you can create and delete a vertex with Alt-MouseClick in Windows or Option-MouseClick on the Mac.
How to start a new polygon.
Use the "duplicate" button to create a copy of the current polygon or polyline.
If you wish, you can then click the "vertex only" toggle at the lower left border which reduces the current object to a single point.
Drag this point, if necessary, to a different place. Then create new vertices with Alt-MouseClick in Windows or Option-MouseClick on the Mac.
    • Share:

Embed Interactive Demonstration New!

Just copy and paste this snippet of JavaScript code into your website or blog to put the live Demonstration on your site. More details »

Files require Wolfram CDF Player or Mathematica.









 
RELATED RESOURCES
Mathematica »
The #1 tool for creating Demonstrations
and anything technical.
Wolfram|Alpha »
Explore anything with the first
computational knowledge engine.
MathWorld »
The web's most extensive
mathematics resource.
Course Assistant Apps »
An app for every course—
right in the palm of your hand.
Wolfram Blog »
Read our views on math,
science, and technology.
Computable Document Format »
The format that makes Demonstrations
(and any information) easy to share and
interact with.
STEM Initiative »
Programs & resources for
educators, schools & students.
Computerbasedmath.org »
Join the initiative for modernizing
math education.
Step-by-step Solutions »
Walk through homework problems one step at a time, with hints to help along the way.
Wolfram Problem Generator »
Unlimited random practice problems and answers with built-in Step-by-step solutions. Practice online or make a printable study sheet.
Wolfram Language »
Knowledge-based programming for everyone.
Powered by Wolfram Mathematica © 2014 Wolfram Demonstrations Project & Contributors  |  Terms of Use  |  Privacy Policy  |  RSS Give us your feedback
Note: To run this Demonstration you need Mathematica 7+ or the free Mathematica Player 7EX
Download or upgrade to Mathematica Player 7EX
I already have Mathematica Player or Mathematica 7+