0% found this document useful (0 votes)
118 views26 pages

OpenShapeFactory Manual

Architectural Design OpenShapefactory is a MiddleMan between you, OpenCascade and QT, it serves as a Geometry Factory

Uploaded by

Heather Perkins
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
118 views26 pages

OpenShapeFactory Manual

Architectural Design OpenShapefactory is a MiddleMan between you, OpenCascade and QT, it serves as a Geometry Factory

Uploaded by

Heather Perkins
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 26

Brep Programming Language for

Architectural Design

OpenShapeFactory Manual

Author:
a de Leo
n
Alexander Pen

May 17, 2012

Contents
1 Introduction

2 Boundary Representation

Interface

3 The
3.1
3.2
3.3

II

Application
Code Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Menus and Toolbars . . . . . . . . . . . . . . . . . . . . . . . . .
ViewPort Manipulations . . . . . . . . . . . . . . . . . . . . . . .

OpenShape Factory Commands

4
5
5
5

4 Sliders
4.1 getval(position,minval,maxval) . . . . . . . . . . . . . . . . . . .

7
7

5 File
5.1
5.2
5.3
5.4
5.5
5.6

.
.
.
.
.
.

7
7
7
7
7
7
8

6 Viewport
6.1 fitall . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.2 vis(objectname) . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.3 viscurvature(objectname) . . . . . . . . . . . . . . . . . . . . . .

8
8
8
8

7 Point Geometry
7.1 makepoint(x,y,z) . . . . . . . . . . . . . . . . .
7.1.1 makepointfromlist(list) . . . . . . . . . .
7.2 makepointmovebyvector(point,vector,distance)
7.3 makepointoncurve(curve,ratio) . . . . . . . . .

.
.
.
.

8
8
9
9
9

features
makeuvpt(srf,u,v) . . . . . . . . . . . . . . . . . . . . . . . . . . .
makeuvvec(srf,u,v) . . . . . . . . . . . . . . . . . . . . . . . . . .
getcoord(point,subparmposition) . . . . . . . . . . . . . . . . . .

9
9
10
10

8 UV
8.1
8.2
8.3

System and Misc


getfile . . . . . . . . . . .
getfileonce(filenamepath) .
getdir . . . . . . . . . . .
getdironce(dirpath) . . . .
readcsv(filename); . . . .
watchfile(filepath) . . . .

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.

.
.
.
.
.
.

.
.
.
.

.
.
.
.
.
.

.
.
.
.

.
.
.
.
.
.

.
.
.
.

.
.
.
.
.
.

.
.
.
.

.
.
.
.
.
.

.
.
.
.

.
.
.
.
.
.

.
.
.
.

.
.
.
.
.
.

.
.
.
.

.
.
.
.
.
.

.
.
.
.

9 Vectors
9.1 makeuvvec(srf,u,v) . . . . . . . . . . .
9.2 makevector(u,v,w) . . . . . . . . . . .
9.3 makevectortangenttocurve(curve,ratio)
9.4 crossproduct(v1,v2) . . . . . . . . . .

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

10
10
10
10
10

10 Planes
10
10.1 makeplane(point,vector) . . . . . . . . . . . . . . . . . . . . . . . 10
11 Curve Geometry
11.1 makelineptdir(p1,v1,length1,length2)
11.2 makelineptpt(p1,p2) . . . . . . . . .
11.3 makebspline(pointlist) . . . . . . . .
11.3.1 makebspline Example: . . . .
11.4 makecircle(point,vector,radius) . . .
11.4.1 makecircle Example: . . . . .

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

.
.
.
.
.
.

11
11
11
11
11
11
12

12 Surfaces
12
12.1 makefillsrf(shapelist) . . . . . . . . . . . . . . . . . . . . . . . . . 12
12.2 makeloft(shapelist) . . . . . . . . . . . . . . . . . . . . . . . . . . 12
12.3 makeoffsetsurface(surface,offsetval) . . . . . . . . . . . . . . . . . 12
13 Import / Export
12
13.1 importigs(filepath) . . . . . . . . . . . . . . . . . . . . . . . . . . 12
13.2 importstp(filepath) . . . . . . . . . . . . . . . . . . . . . . . . . . 12
14 Lists
14.1 addpointtolist(pointlist,point) .
14.2 addshapetolist(shapelist,object)
14.3 makeshapelist . . . . . . . . . .
14.4 makepointlist . . . . . . . . . .

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

12
12
13
13
13

15 Measure
13
15.1 getdistance(p1,p2) . . . . . . . . . . . . . . . . . . . . . . . . . . 13
16 Operations
13
16.1 makerotate(obj,vector,angle) . . . . . . . . . . . . . . . . . . . . 13
16.2 makesymmetry(obj,plane) . . . . . . . . . . . . . . . . . . . . . . 13
16.3 maketranslatebylength(obj,vector,distance) . . . . . . . . . . . . 13
17 Math
13
17.1 mcosh(parameter) . . . . . . . . . . . . . . . . . . . . . . . . . . 14
17.2 msinh(parameter) . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
18 utility
14
18.1 panelize(srf,u,v,panelfunc(p1,p2,p3,p4)) . . . . . . . . . . . . . . 14
3

19 Debug
14
19.1 print(msg); . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
19.2 printlist(list); . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14

III

OpenShapeFactory Examples

14

20 Make a single Point

15

21 Make a Point Loop

15

22 Make a Line Between 2 points

15

23 Kilian Roof

15

24 make hyperboloid points and ellipsoid points

18

IV

19

ECMAscript-262

25 ECMAScript Reference
25.1 The Global Object . .
25.2 Constructor Properties
25.3 Other Properties . . .
25.4 Array Objects . . . . .
25.5 Number Objects . . .
25.6 The Math Object . . .
25.7 Date Objects . . . . .
25.8 RegExp Objects . . .
25.9 Error Objects . . . . .
25.10The JSON Object . .

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

.
.
.
.
.
.
.
.
.
.

19
19
20
20
20
21
22
22
23
23
23

OpenShapeFactory: open-source geometry kernel


May 17, 2012
Abstract
This is the official documention of OpenShapeFactory, in the following
sections we will introduce the reader to OpenShapeFactory, and document
in detail every command available to the system. OpenShapeFactory is an
open-source BREP programming language, it enables to automate BREPs
using an economical codex of functions and routines, OpenShapeFactory
makes extensive use of the open-source BREP geometry kernel OpenCascade, and the Qt Library for Graphical User Interface and scripting
facilities.

Introduction

Figure 1: Diagram of OpenShapeFactory internal structure


OpenShapefactory is a MiddleMan between you, OpenCascade and QT, it
serves as a Geometry Factory wrapping OpenCascade, and providing a singlepoint of entry to the creation of most geometrical operations.In a Gecko - OpenShapeFactory allows you to:
1. create Brep-Geometry: i.e ( sweeps, loft surface, revolvesurface, face,edge,etc);
2. visualize the geometry into a 3d viewport.
3. link QtWidgets created manually in the Qt-Designer to Update Functions
that Create Geometry.
4. Get direct access to the HSF library using QtScript( ECMA/Javascript)
using the ScriptWidget.
5

Boundary Representation

The Geometry in OpenShapeFactory is represented using Boundary Representation, Boundary representation models are composed of two parts: topology
and geometry (surfaces, curves and points). The main topological items are:
faces, edges and vertices. A face is a bounded portion of a surface; an edge is a
bounded piece of a curve and a vertex lies at a point. Other elements are the
shell (a set of connected faces), the loop (a circuit of edges bounding a face) and
loop-edge links (also known as winged edge links or half-edges) which are used
to create the edge circuits. The edges are like the edges of a table, bounding a
surface portion.[from Wikipedia]

Part I

Interface
3

The Application

Figure 2: Main Interface of OpenShapeFactory


The openshapefactory is divided literally between a 2d surface left and a
3d surface right as shown on figure 2. the 2d surface is a diagrammatic panel
where widgets are loaded, in the case of the precompiled download, a QScintilla
text-editor widget with programmatic access to the openshapefactory is automatically added as the only widget. To the right of the 2d panel you have the
6

3d view port, any change to the code that results from a visible shape will be
immediately visible in the 3d view port.

3.1

Code Editor

Figure 3: The Code Editor

3.2

Menus and Toolbars

Figure 4 indicates the available menus and toolbars:

3.3

ViewPort Manipulations

basic 2d manipulations:
1. panning : right-click and drag on 2d panel background
2. zoomming : use the scroll-wheel on your mouse, or the right side of your
touch pad on a laptop
3. moving widgets : left-click and drag on the gray area around any widget
7

Figure 4: Menus and Toolbars

basic 3d viewport manipulation:


1. panning : press control + holding down the middle mouse button(scroll
wheel)

2. zoom : press control + holding down the left mouse button

3. orbit : press control + holding right mouse button

Part II

OpenShape Factory Commands


4
4.1

Sliders
getval(position,minval,maxval)

creates a slider in the front end of the scriptwidget, position is the order in
which you would like to display the slider in the front end, if you specify 0 as
the position it will be the first.
Minvalue is the left limit of the slider, Maxvalue is the right limit of the
slider

5
5.1

File System and Misc


getfile

Displays a filesystem dialog to locate a file and returns the filepath of the file
selected.

5.2

getfileonce(filenamepath)

same as getfile except forces the system to load the file only once, notice how
check shows on the interface allowing the user to select whether they want to
respect the single execution of the operation.

5.3

getdir

opens a filesystem dialog for locating a directory or folder

5.4

getdironce(dirpath)

same as getdir except forces the system to load the directory only once, notice
how check shows on the interface allowing the user to select whether they want
to respect the single execution of the operation.

5.5

readcsv(filename);

Load a comma seperated file as list: every row in the file is a list item every
item contains a subitem for every comma seperated element
9

5.6

watchfile(filepath)

link the evaluation of the script to execute, for every change in the file specified by filepath. if for instance you watch an igs file and that file is afterwards
modified by Rhino or Catia, simply by overriding the file, the code in OpenShapefactory will re-evaluate.

6
6.1

Viewport
fitall

fits the view to the bounding box of the geometry content of the script

6.2

vis(objectname)

Display the object in the viewport Any object that is created and is not visualized will be created in memory, but will no show on the viewport

6.3

viscurvature(objectname)

Display the object in the viewport with curvature information Any object that
is created and is not visualized will be created in memory, but will no show on
the viewport

Figure 5: Gaussian Curvature with the viscurvature command

7
7.1

Point Geometry
makepoint(x,y,z)

creates a point by the x y z coordinate note you must call the vis command and
pass the point to visualize it.
10

7.1.1

makepointfromlist(list)

Creates a Series of points from a list of values in the format:


x,y,z
x,y,z
...

7.2

makepointmovebyvector(point,vector,distance)

move a point in the direction of a vector using the distance as the amount of
units you want the point to move in the direction of the vector.

7.3

makepointoncurve(curve,ratio)

create a point on a curve as a percentage of the curve length, the ratio should
be a value from 0 to 1, 0 represents the start of the curve and 1 represents the
end of the curve, for example 0.5 would be the middle of the curve.

UV features

Figure 6: uv space of surface

8.1

makeuvpt(srf,u,v)

create a point on the surface at the u and v coordinates, both the u and v values
requires a value between 0 and 1 on a parametrized surface.
if importing your geometry from rhino make sure to call the reparametrize
command on the surface, and specify the start parameter as 0 and the end
parameter as 1.
11

8.2

makeuvvec(srf,u,v)

create a vector normal to the surface at the u and v coordinates, both the u and
v values requires a value between 0 and 1 on a parametrized surface.
if importing your geometry from rhino make sure to call the reparametrize
command on the surface, and specify the start parameter as 0 and the end
parameter as 1.

8.3

getcoord(point,subparmposition)

gets the subcoordinate value of a point, for example if you had a point named p1
and you wanted to extract the z coordinate of the point you would so by calling
the function requesting the 3rd subcoordinate this way: z = getcoord(p1,3)

9
9.1

Vectors
makeuvvec(srf,u,v)

create a vector normal to the surface at the u and v coordinates, both the u and
v values requires a value between 0 and 1 on a parametrized surface.
if importing your geometry from rhino make sure to call the reparametrize
command on the surface, and specify the start parameter as 0 and the end
parameter as 1.

9.2

makevector(u,v,w)

create a vector using the u v w as its component directions.

9.3

makevectortangenttocurve(curve,ratio)

create vector tangent to the curve at location specified by ratio as a percentage


of the curve length.
this value should be between 0 and 1.

9.4

crossproduct(v1,v2)

Calculates the cross product of two vectors, v1 is the first vector and v2 is the
vector located to the right of vector2

10
10.1

Planes
makeplane(point,vector)

create a plane by using a point to locate the centre of the plane and a vector to
represent the direction perpendicular to the plane
12

Figure 7: crossproduct of two vectors

11

Curve Geometry

11.1

makelineptdir(p1,v1,length1,length2)

create a line on the point in the direction specified by v1, extending length1
amounts in the negative direction and length2 amounts in the positive direciton

11.2

makelineptpt(p1,p2)

Create a Line connecting p1 and p2

11.3

makebspline(pointlist)

Creates a B-Spline curve from a list of points, create a point list using the
makepointlist command and afterwards add the points using the addpointtolist
command.
11.3.1
p1
p2
p3
p4

=
=
=
=

makebspline Example:

makepoint(0,0,0)
makepoint(10,0,30)
makepoint(10,10,30)
makepoint(0,10,0)

mypointlist
mypointlist
mypointlist
mypointlist
mypointlist

=
=
=
=
=

makepointlist()
addpointtolist(mypointlist,p1)
addpointtolist(mypointlist,p2)
addpointtolist(mypointlist,p3)
addpointtolist(mypointlist,p4)

mybspline = makebspline(mypointlist)

11.4

makecircle(point,vector,radius)

creates a circle from its center point , a vector determining its perpendicular
direction , and it radius
13

11.4.1

makecircle Example:

radius = getval(0,1,200) //slider controlling the radius


p1 = makepoint(0,0,0) //oring point
v1 = makevector(0,0,1) // vector facing up in the z direction
circle1 = makecircle(p1,v1,radius)
vis(circle1)

12
12.1

Surfaces
makefillsrf(shapelist)

Create Coons surface, this surface fills the content of a curve or series of curves
given by the list.

12.2

makeloft(shapelist)

Create a Loft surface that passes through a list of curves, specified as crosssections

12.3

makeoffsetsurface(surface,offsetval)

Create an offset surface from the given surface using the offsetval as the amount
of units you want the offset surface to be away from the original reference surface.

13
13.1

Import / Export
importigs(filepath)

Imports an igs file and returns the brep of the file as a single shape

13.2

importstp(filepath)

Imports an step file and returns the brep of the file as a single shape

14
14.1

Lists
addpointtolist(pointlist,point)

Adds a point to a list, this list is issually referenced by a function such as


makebspline, or any other function that requires a list.
14

14.2

addshapetolist(shapelist,object)

Adds a shape to a list, this list is issually referenced by a function such as


makeloft() or makefillsrf(), or any other function that requires a brep list.

14.3

makeshapelist

creates a blank shape list, after using this command, normally you would invoke the addshapetolist(listname,objectotadd) in order to populate the list with
shapes.
this list can then be given as the input to a function such as makeloft.

14.4

makepointlist

creates a blank point list, after using this command, normally you would invoke
the addpointtolist(listname,pointtoadd) in order to populate the list with points.
this list can then be given as the input to a function such as makebspline.

15
15.1

Measure
getdistance(p1,p2)

calculate the distance between two points

16
16.1

Operations
makerotate(obj,vector,angle)

Rotate an object using the vector as the rotation axis and the angles as the
amount of angles to rotate in relation to its current location.

16.2

makesymmetry(obj,plane)

create a symmetry object of the object specified using the plane as the plane of
symmetry

16.3

maketranslatebylength(obj,vector,distance)

Translate an object as many units specified in distance, in the direction of the


vector specified.

17

Math

to invoke Math Functions call Math.functionname for the case of the hyperbolic
cosine we had to forward the c++ version to the script. for the case of the
hyperbolic sine we had to forward the c++ version to the script.
15

17.1

mcosh(parameter)

hyperbolic cosine

17.2

msinh(parameter)

hyperbolic sine

18
18.1

utility
panelize(srf,u,v,panelfunc(p1,p2,p3,p4))

This function creates a grid scaffold around the surface, the function creates
as many panels specified by the u and v parameters, the user must create a
panelfunction with four points as inputs:
function
{

mypanel(p1,p2,p3,p4)

vis(p1)
vis(p3)
//vis(p2)
diag1 = makelineptpt(p1,p3)
diag2 = makelineptpt(p2,p4)
midp1 = makepointoncurve(diag1,0.5)
vis(midp1)
vis(diag1)
vis(diag2)
}

19
19.1

Debug
print(msg);

print value in the listener area

19.2

printlist(list);

print a list of values in the listener area

16

Part III

OpenShapeFactory Examples
In this section we will introduce, examples to illustrate the use of OpenShapeFactory.

20

Make a single Point

Type the following code in the code editor and see the geometry update as you
type.
p1 = makepoint(0,0,0) // create a point
vis(p1) // showpoint on viewport

21

Make a Point Loop

Type the following code in the code editor and see the geometry update as you
type.
for(i = 1 ; i < 100 ; i++)
{
p1 = makepoint(i*i,i*10,0) // create a point
vis(p1) // showpoint on viewport
}

22

Make a Line Between 2 points

Type the following code in the code editor and see the geometry update as you
type.
p1 = makepoint(0,0,0) // create a point
vis(p1) // showpoint on viewport
p2 = makepoint(0,30,0) // create a point
vis(p2) // showpoint on viewport
l1 = makelineptpt(p1,p2) // make a line between 2 points
vis(l1) //show the line in the viewport

23

Kilian Roof

In this example we demonstrate how to create a loft surface by developing a


custom crossection using user defined functions, also populating panels on the
surface using a user defined panel delegate function as shown in figure ??.
17

Figure 8: Kilian roof Example


I have provided an utility function called panelize, this function subdivides a
surface into rectangular regions, as many regions you want on the u direction of
the surface, and as many regions you want on the v direction. on each region you
will always get 4 points, this is the signature required by your custom function,
in this case called mypanel, this function accepts 4 points, inside the function
you can do anything you want with those 4 points, the 4 points represent the 4
corners of each panel, in this case we draw 2 diagonals across p1-p3 and p2-4,
since this executed over all panels, we get the effect of diagonals running across
the overall surface, when in fact the effect is only being executed on a per panel
basis, have fun!.
when running this example make sure the x1 x2 x3 and x4 sliders are distributed in an incrementing order at first, for example set x1 at 0 , x2 at 25 ,
x3 at 50 and x4 at 100
the sliders represent the 3 points of the spine controlling the surface, if they
are twisting in space the surface might not generate as nicely, the z value of
each point controls the width of the crossection at each interval.
minval = -300
maxval = 300
x1 = getval(0,minval,maxval)
y1 = getval(1,minval,maxval)
z1 = getval(2,0,maxval)
x2
y2
z2

=
=
=

getval(3,minval,maxval)
getval(4,minval,maxval)
getval(5,0,maxval)

x3
y3

=
=

getval(6,minval,maxval)
getval(7,minval,maxval)
18

z3

getval(8,0,maxval)

x4
y4
z4

=
=
=

getval(9,minval,maxval)
getval(10,minval,maxval)
getval(11,0,maxval)

p1
p2
p3
p4

=
=
=
=

makepoint(x1,y1,0)
makepoint(x2,y2,0)
makepoint(x3,y3,0)
makepoint(x4,y4,0)

splineset = makepointlist()
splineset = addpointtolist(splineset,p1)
splineset = addpointtolist(splineset,p2)
splineset = addpointtolist(splineset,p3)
splineset = addpointtolist(splineset,p4)
spline1 = makebspline(splineset)
vis(spline1)
crs1
crs2
crs3
crs4

=
=
=
=

loftlist=
loftlist
loftlist
loftlist
loftlist
loft1 =

crossection(spline1,0,z1,z1)
crossection(spline1,0.25,z2,z2)
crossection(spline1,0.75,z3,z3)
crossection(spline1,1,z4,z4)
makeshapelist()
= addshapetolist(loftlist,crs1)
= addshapetolist(loftlist,crs2)
= addshapetolist(loftlist,crs3)
= addshapetolist(loftlist,crs4)
makeloft(loftlist)

panelize(loft1,10,10,mypanel)
function crossection(spline,percent,width,height)
{
ratio = percent
width = (width/2) +1
height = height + 1
up = makevector(0,0,1)
p1 = makepointoncurve(spline1,ratio)
v1 = makevectortangenttocurve(spline1,ratio)
l1 = makelineptdir(p1,v1,0,width)
left =
makerotate(l1,p1,up,-90)
right =
makerotate(l1,p1,up,90)
endpl = makepointoncurve(left,1)
endpr = makepointoncurve(right,1)
19

upline
endpup

=
=

makelineptdir(p1,up,0,height)
makepointoncurve(upline,1)

curvelist = makepointlist()
curvelist = addpointtolist(curvelist,endpl)
curvelist = addpointtolist(curvelist, endpup)
curvelist = addpointtolist(curvelist,endpr)
curve = makebspline(curvelist)
//vis(curve)
return
}

curve

function
{

mypanel(p1,p2,p3,p4)

vis(p1)
vis(p3)
//vis(p2)
diag1 = makelineptpt(p1,p3)
diag2 = makelineptpt(p2,p4)
midp1 = makepointoncurve(diag1,0.5)
vis(midp1)
vis(diag1)
vis(diag2)
}

24

make hyperboloid points and ellipsoid points

ucount = getval(0,1,100)
vcount = getval(0,1,100)
upercent = getval(0,1,100)
vpercent = getval(0,1,100)
a = getval(1,1,100)
b = getval(2,1,100)
c = getval(3,1,100)
upival = 2 * 3.14 * (upercent/100)
vpival = 2 * 3.14 * (vpercent/100)
a1 = a /100
b1 = b /100
c1 = c /100
a2 = a/4 /100
20

b2 =
c2 =

b /100
c /3 /100

for (i=0;i<ucount;i++) {
u = (upival/ ucount) * i
for (j=0;j<vcount;j++) {
v = (vpival / vcount) *
x=a1 * Math.cos(u) *
y=b1 * Math.sin(u) *
z= c1 * Math.cos(v)

Math.sin(v)
Math.sin(v)

x2=a2 * mcosh(v) * Math.cos(u)


y2 = a2 * mcosh(v) * Math.sin(u)
z2= c2 * msinh(v) -0.3
p1 = makepoint(x,y,z)
p2 = makepoint(x2,y2,-z2)
l1
= makelineptpt(p1,p2)
vis(l1)
vis(p2)
vis(p1)
}
}

Part IV

ECMAscript-262
25

ECMAScript Reference

This reference contains a list of built-in objects, functions and properties supported by QtScript. For a detailed description, see the ECMA-262 specification.

25.1

The Global Object

NaN
Infinity
undefined
eval(x)
parseInt(string, radix)
parseFloat(string)
isNaN(number)
21

isFinite(number)
decodeURI(encodedURI)
decodeURIComponent(encodedURIComponent)
encodeURI(uri)
encodeURIComponent(uriComponent)

25.2

Constructor Properties

Object
Function
Array
String
Boolean
Number
Date
RegExp
Error
EvalError
RangeError
ReferenceError
SyntaxError
TypeError
URIError

25.3

Other Properties

Math
JSON
Object Objects
Object Constructor
Function Properties
getPrototypeOf(O)
getOwnPropertyDescriptor(O, P)
getOwnPropertyNames(O)
create(O [, Properties])
defineProperty(O, P, Attributes)
defineProperties(O, Properties)
keys(O)

25.4

Array Objects

toString()
toLocaleString()
concat([item1 [, item2 [, ...]]])
join(separator)
pop()
22

push([item1 [, item2 [, ...]]])


reverse()
shift()
slice(start, end)
sort(comparefn)
splice(start, deleteCount[, item1 [, item2 [, ...]]])
unshift([item1 [, item2 [, ...]]])
indexOf(searchElement [, fromIndex])
lastIndexOf(searchElement [, fromIndex])
every(callbackfn [, thisArg])
some(callbackfn [, thisArg])
forEach(callbackfn [, thisArg])
map(callbackfn [, thisArg])
filter(callbackfn [, thisArg])
reduce(callbackfn [, initialValue])
reduceRight(callbackfn [, initialValue])
\subsection{String Objects}
toString()
valueOf()
charAt(pos)
charCodeAt(pos)
concat([string1 [, string2 [, ...]]])
indexOf(searchString ,position)
lastIndexOf(searchString, position)
localeCompare(that)
match(regexp)
replace(searchValue, replaceValue)
search(regexp)
slice(start, end)
split(separator, limit)
substring(start, end)
toLowerCase()
toLocaleLowerCase()
toUpperCase()
toLocaleUpperCase()
trim()

25.5

Number Objects

toString(radix)
toLocaleString()
toFixed(fractionDigits)
toExponential(fractionDigits)
toPrecision(precision)
23

25.6

The Math Object

E
LN10
LN2
LOG2E
LOG10E
PI
$SQRT1_2$
$SQRT2$
Function Properties
abs(x)
acos(x)
asin(x)
atan(x)
atan2(y, x)
ceil(x)
cos(x)
exp(x)
floor(x)
log(x)
max([value1 [, value2 [, ...]]])
min([value1 [, value2 [, ...]]])
pow(x, y)
random()
round(x)
sin(x)
sqrt(x)
tan(x)

25.7

Date Objects

toString()
toDateString()
toTimeString()
toLocaleString()
toLocaleDateString()
toLocaleTimeString()
valueOf()
getTime()
getFullYear()
getUTCFullYear()
getMonth()
getUTCMonth()
getDate()
getUTCDate()
24

getDay()
getUTCDay()
getHours()
getUTCHours()
getMinutes()
getUTCMinutes()
getSeconds()
getUTCSeconds()
getMilliseconds()
getUTCMilliseconds()
getTimeZoneOffset()
setTime(time)
setMilliseconds(ms)
setUTCMilliseconds(ms)
setSeconds(sec [, ms])
setUTCSeconds(sec [, ms])
setMinutes(min [, sec [, ms]])
setUTCMinutes(min [, sec [, ms]])
setHours(hour [, min [, sec [, ms]]])
setUTCHours(hour [, min [, sec [, ms]]])
setDate(date)
setUTCDate(date)
setMonth(month [, date])
setUTCMonth(month [, date])
setFullYear(year [, month [, date]])
setUTCFullYear(year [, month [, date]])
toUTCString()
toISOString()
toJSON()

25.8

RegExp Objects

exec(string)
test(string)
toString()

25.9

Error Objects

name
message
Function Properties
toString()

25.10

The JSON Object

parse(text [, reviver])
25

stringify(value [, replacer [, space]])

26

You might also like