Example: Create an Area with a Hole

Creating areas is easy, as shown in the Editing Drawings topic , but creating areas that include one or more holes involves a slight nuance.   In this example we will create an area with one hole in it.

 

ico_nb_arrow_blue.pngThis topic has not yet been fully updated to reflect extensive new features and changes made in build 9.0.169.8.  Please see the Changes and Additions topic for a guide until this topic has been updated.

 

We begin by creating a new drawing.

 

il_create_area_command.png

 

Open the drawing, and then, as described in the Editing Drawings topic, we choose Create Area for the mode button in the main toolbar.    We open the drawing and click the Create Area tool.  

 

eg_newobj03_01.pngeg_newobj03_01a.png

 

To see the coordinates, click on the Coordinates tab in the Record pane.    We click to start creating an area.

 

eg_newobj03_02.pngeg_newobj03_02a.png

 

In the drawing we begin clicking to create coordinates that define the boundary of our area using straight line segments.  The Coordinates tab of the Record pane automatically reports coordinates as we click to add new vertices.

 

eg_newobj03_03.pngeg_newobj03_03a.png

 

We click at each location we want to mark a coordinate.

 

eg_newobj03_04.pngeg_newobj03_04a.png

 

With each click the proposed area boundary grows.

 

eg_newobj03_05.pngeg_newobj03_05a.png

 

At the last coordinate for the area boundary we Shift-Click to mark the coordinate, to indicate that terminates a branch in the area structure, and to indicate we intend to continue creating the area.  

 

eg_newobj03_06.pngeg_newobj03_06a.png

 

We then click again to indicate the coordinate that will begin the boundary of the "hole" inside the area. The preceding last coordinate in the branch is marked with an inverted T symbol, indicating the end of a branch.

 

eg_newobj03_07.pngeg_newobj03_07a.png

 

As before, each time we click to create a coordinate the boundary of the proposed "hole" is expanded one more segment.

 

eg_newobj03_08.pngeg_newobj03_08a.png

 

At the last coordinate we click to mark the coordinate.

 

eg_newobj03_09.pngeg_newobj03_09a.png

 

We then right-click the mouse anywhere, to call up the context menu for creating the area.  

 

eg_newobj03_10.pngeg_newobj03_10a.png

 

In the context menu we choose Save Changes.  We could also have pressed Ctrl-Enter as a keyboard shortcut.

 

eg_newobj03_11.pngeg_newobj03_11a.png

 

The result is an area object that has a "hole" in it.  We can Alt-click the area to show its attribute values in the Record pane.

 

eg_newobj03_12.pngeg_newobj03_12a.png

 

We click on the Coordinates tab of the Record pane to see coordinates.

 

eg_newobj03_13.pngeg_newobj03_13a.png

 

We can see the area is created from two branches, the ends of each branch being marked by an inverted T symbol.   One branch is the outer area boundary while the other branch is the inner boundary that defines the hole in the area.

 

This example continues into the related example topic, Example: Create an Area with Holes and Islands.

Notes

More holes, please - If we wanted to create more than one hole within the area we could have Shift-clicked the last coordinate of the hole boundary and then clicked into the drawing again to start the next boundary for a hole.

 

Clicking on whole number coordinates - Sometimes when creating objects in drawings, or labels in a labels component, for example, when using Manifold as a CAD editor or using Manifold to create diagrams for illustrations, we would like the coordinates we click for objects to be whole numbers, such as X,Y values of -165, 40 and not -165.4954783999, 40.9398312223.   

 

We can do that by first choosing View - Zoom to Native before we begin clicking to create objects.  That adjusts the scale in use so that each pixel on screen that can be clicked corresponds to a whole number coordinate value.   That works for either standalone drawing or label windows or for drawing or labels layers in a map window.

See Also

Drawings

 

Coordinates

 

Example: Draw Lines, Areas and Points - Simple example of using basic mouse moves to add points, lines and areas to a drawing.

 

Example: Trace an Area in a Map over an Image Background - In a map with a drawing layer above an image layer, create an area object in the drawing by tracing over the outlines of something seen in the image layer below.

 

Example: Create a Line using the Record Pane - Step by step creation and modification of a line in a drawing using the Record pane's Coordinates tab.

 

Example: Create an Area with Holes and Islands - Create an area in a drawing where the area includes holes and also islands.

 

Example: Create a Multipoint - How to create multipoints. This topic provides two examples:  First we create a multipoint and then next we create a multipoint having two branches.  The purpose of this topic is to help teach the implementation of geometry in Manifold and other typical spatial packages using a somewhat unusual and rarely met object type, the multipoint, which combines what appear to be many separate points into a single multipoint object.