You are a guest. Restricted access. Read more.
SCaVis manual

Interactive geometry

For drawing iterative geometrical objects, use the class HZirkel which is re-write of the well-known C.a.R/Zirkel (Compass and Ruler Construct and Rule) project. SCaVis uses a Swing-rewrite of this program called CarMetal. The source code has several modifications in order to run this program using a scripting language.

This is a small example of how to manipulate with geometrical objects from the package “carmetal.objects”.

Code example

  Download for this example is disabled for non-members
 1: from jhplot import *
 2: from carmetal.objects import *
 4: c1=HZirkel(600,600)
 5: C=c1.getConstruction()
 6: c1.setAxis(1)
 8: # draw a point
 9: p1=PointObject(C,1.0,1.0)
10: c1.draw(p1)
12: # draw a line
13: p1=LineObject(C,PointObject(C,-3,3), PointObject(C,3.0,-3.0), )
14: c1.draw(p1)
16: # draw a circle
17: p1=CircleObject(C,PointObject(C,0,0), PointObject(C,3.0,-3.0), )
18: c1.draw(p1)
20: # export to a PNG image
21: c1.export("figure.png")

The output is shown below:

Click here to see the output of this script

Click here to see the output of this script

Click here to see the output of this script

man/visual/geometry.txt · Last modified: 2013/12/23 23:49 by admin
CC Attribution-Share Alike 3.0 Unported
Powered by PHP Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0 Valid HTML5