Skip to main content Accessibility help
×
Hostname: page-component-848d4c4894-sjtt6 Total loading time: 0 Render date: 2024-07-03T09:17:22.322Z Has data issue: false hasContentIssue false

9 - Geometry and Drawings

Published online by Cambridge University Press:  05 June 2012

Guy Cousineau
Affiliation:
Ecole Normale Supérieure, Paris
Michel Mauny
Affiliation:
Institut National de Recherche en Informatique et en Automatique (INRIA), Rocquencourt
Get access

Summary

This chapter is devoted to functionally programming geometric drawings. We use types and graphic functions from the library MLgraph, and we briefly describe them before we use them.

The graphic approach of MLgraph is the same as PostScript, a language used particularly for programming laser printers. This approach is oriented toward programming drawings meant to illustrate documents, rather than toward the display of drawings on screen, though there is software to display PostScript drawings as well. Such software provides a reasonable approximation of the drawings, but the quality is limited by the actual screen resolution.

PostScript is an imperative language, indeed, a low-level imperative language, which was not meant to be used directly but rather to be generated by software to produce drawings or to type-set text. The approach we present here uses the graphic model of PostScript, but replaces that language by Caml. This enables us to provide much higher level construction functions for drawing.

The graphic model of PostScript freely uses an infinite Cartesian plane with no limit on the coordinates. The basic objects are initially sketched on this plane in absolute coordinates, but a user can then freely apply transformations to modify their size and position. Such transformations rapidly get out of the constraints about positioning and let us construct complicated drawings by functionally combining simpler ones.

At first glance, producing drawings by programming seems less pleasant than using software to draw interactively, especially if we want to produce a particular design rapidly.

Type
Chapter
Information
Publisher: Cambridge University Press
Print publication year: 1998

Access options

Get access to the full version of this content by using one of the access options below. (Log in options will check for institutional or personal access. Content may require purchase if you do not have access.)

Save book to Kindle

To save this book to your Kindle, first ensure coreplatform@cambridge.org is added to your Approved Personal Document E-mail List under your Personal Document Settings on the Manage Your Content and Devices page of your Amazon account. Then enter the ‘name’ part of your Kindle email address below. Find out more about saving to your Kindle.

Note you can select to save to either the @free.kindle.com or @kindle.com variations. ‘@free.kindle.com’ emails are free but can only be saved to your device when it is connected to wi-fi. ‘@kindle.com’ emails can be delivered even when you are not connected to wi-fi, but note that service fees apply.

Find out more about the Kindle Personal Document Service.

  • Geometry and Drawings
  • Guy Cousineau, Ecole Normale Supérieure, Paris, Michel Mauny, Institut National de Recherche en Informatique et en Automatique (INRIA), Rocquencourt
  • Translated by K. Callaway
  • Book: The Functional Approach to Programming
  • Online publication: 05 June 2012
  • Chapter DOI: https://doi.org/10.1017/CBO9781139173018.013
Available formats
×

Save book to Dropbox

To save content items to your account, please confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account. Find out more about saving content to Dropbox.

  • Geometry and Drawings
  • Guy Cousineau, Ecole Normale Supérieure, Paris, Michel Mauny, Institut National de Recherche en Informatique et en Automatique (INRIA), Rocquencourt
  • Translated by K. Callaway
  • Book: The Functional Approach to Programming
  • Online publication: 05 June 2012
  • Chapter DOI: https://doi.org/10.1017/CBO9781139173018.013
Available formats
×

Save book to Google Drive

To save content items to your account, please confirm that you agree to abide by our usage policies. If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account. Find out more about saving content to Google Drive.

  • Geometry and Drawings
  • Guy Cousineau, Ecole Normale Supérieure, Paris, Michel Mauny, Institut National de Recherche en Informatique et en Automatique (INRIA), Rocquencourt
  • Translated by K. Callaway
  • Book: The Functional Approach to Programming
  • Online publication: 05 June 2012
  • Chapter DOI: https://doi.org/10.1017/CBO9781139173018.013
Available formats
×