Upload
heather-perkins
View
11
Download
0
Embed Size (px)
DESCRIPTION
Architectural DesignOpenShapefactory is a MiddleMan between you, OpenCascade and QT, itserves as a Geometry Factory
Citation preview
Brep Programming Language forArchitectural Design
OpenShapeFactory Manual
Author:Alexander Pena de Leon
May 17, 2012
Contents
1 Introduction 3
2 Boundary Representation 4
I Interface 4
3 The Application 4
3.1 Code Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
3.2 Menus and Toolbars . . . . . . . . . . . . . . . . . . . . . . . . . 5
3.3 ViewPort Manipulations . . . . . . . . . . . . . . . . . . . . . . . 5
II OpenShape Factory Commands 6
4 Sliders 7
4.1 getval(position,minval,maxval) . . . . . . . . . . . . . . . . . . . 7
5 File System and Misc 7
5.1 getfile . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
5.2 getfileonce(filenamepath) . . . . . . . . . . . . . . . . . . . . . . . 7
5.3 getdir . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
5.4 getdironce(dirpath) . . . . . . . . . . . . . . . . . . . . . . . . . . 7
5.5 readcsv(filename); . . . . . . . . . . . . . . . . . . . . . . . . . . 7
5.6 watchfile(filepath) . . . . . . . . . . . . . . . . . . . . . . . . . . 8
6 Viewport 8
6.1 fitall . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
6.2 vis(objectname) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
6.3 viscurvature(objectname) . . . . . . . . . . . . . . . . . . . . . . 8
7 Point Geometry 8
7.1 makepoint(x,y,z) . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
7.1.1 makepointfromlist(list) . . . . . . . . . . . . . . . . . . . . 9
7.2 makepointmovebyvector(point,vector,distance) . . . . . . . . . . 9
7.3 makepointoncurve(curve,ratio) . . . . . . . . . . . . . . . . . . . 9
8 UV features 9
8.1 makeuvpt(srf,u,v) . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
8.2 makeuvvec(srf,u,v) . . . . . . . . . . . . . . . . . . . . . . . . . . 10
8.3 getcoord(point,subparmposition) . . . . . . . . . . . . . . . . . . 10
2
9 Vectors 109.1 makeuvvec(srf,u,v) . . . . . . . . . . . . . . . . . . . . . . . . . . 109.2 makevector(u,v,w) . . . . . . . . . . . . . . . . . . . . . . . . . . 109.3 makevectortangenttocurve(curve,ratio) . . . . . . . . . . . . . . . 109.4 crossproduct(v1,v2) . . . . . . . . . . . . . . . . . . . . . . . . . 10
10 Planes 1010.1 makeplane(point,vector) . . . . . . . . . . . . . . . . . . . . . . . 10
11 Curve Geometry 1111.1 makelineptdir(p1,v1,length1,length2) . . . . . . . . . . . . . . . . 1111.2 makelineptpt(p1,p2) . . . . . . . . . . . . . . . . . . . . . . . . . 1111.3 makebspline(pointlist) . . . . . . . . . . . . . . . . . . . . . . . . 11
11.3.1 makebspline Example: . . . . . . . . . . . . . . . . . . . . 1111.4 makecircle(point,vector,radius) . . . . . . . . . . . . . . . . . . . 11
11.4.1 makecircle Example: . . . . . . . . . . . . . . . . . . . . . 12
12 Surfaces 1212.1 makefillsrf(shapelist) . . . . . . . . . . . . . . . . . . . . . . . . . 1212.2 makeloft(shapelist) . . . . . . . . . . . . . . . . . . . . . . . . . . 1212.3 makeoffsetsurface(surface,offsetval) . . . . . . . . . . . . . . . . . 12
13 Import / Export 1213.1 importigs(filepath) . . . . . . . . . . . . . . . . . . . . . . . . . . 1213.2 importstp(filepath) . . . . . . . . . . . . . . . . . . . . . . . . . . 12
14 Lists 1214.1 addpointtolist(pointlist,point) . . . . . . . . . . . . . . . . . . . . 1214.2 addshapetolist(shapelist,object) . . . . . . . . . . . . . . . . . . . 1314.3 makeshapelist . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1314.4 makepointlist . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
15 Measure 1315.1 getdistance(p1,p2) . . . . . . . . . . . . . . . . . . . . . . . . . . 13
16 Operations 1316.1 makerotate(obj,vector,angle) . . . . . . . . . . . . . . . . . . . . 1316.2 makesymmetry(obj,plane) . . . . . . . . . . . . . . . . . . . . . . 1316.3 maketranslatebylength(obj,vector,distance) . . . . . . . . . . . . 13
17 Math 1317.1 mcosh(parameter) . . . . . . . . . . . . . . . . . . . . . . . . . . 1417.2 msinh(parameter) . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
18 utility 1418.1 panelize(srf,u,v,panelfunc(p1,p2,p3,p4)) . . . . . . . . . . . . . . 14
3
19 Debug 1419.1 print(msg); . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1419.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 ECMAscript-262 19
25 ECMAScript Reference 1925.1 The Global Object . . . . . . . . . . . . . . . . . . . . . . . . . . 1925.2 Constructor Properties . . . . . . . . . . . . . . . . . . . . . . . . 2025.3 Other Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . 2025.4 Array Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2025.5 Number Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . 2125.6 The Math Object . . . . . . . . . . . . . . . . . . . . . . . . . . . 2225.7 Date Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2225.8 RegExp Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . 2325.9 Error Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2325.10The JSON Object . . . . . . . . . . . . . . . . . . . . . . . . . . 23
4
OpenShapeFactory: open-source geometry kernel
May 17, 2012
Abstract
This is the official documention of OpenShapeFactory, in the followingsections we will introduce the reader to OpenShapeFactory, and documentin detail every command available to the system. OpenShapeFactory is anopen-source BREP programming language, it enables to automate BREPsusing an economical codex of functions and routines, OpenShapeFactorymakes extensive use of the open-source BREP geometry kernel Open-Cascade, and the Qt Library for Graphical User Interface and scriptingfacilities.
1 Introduction
Figure 1: Diagram of OpenShapeFactory internal structure
OpenShapefactory is a MiddleMan between you, OpenCascade and QT, itserves as a Geometry Factory wrapping OpenCascade, and providing a single-point of entry to the creation of most geometrical operations.In a Gecko - Open-ShapeFactory 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 QtWidget’s created manually in the Qt-Designer to Update Functionsthat Create Geometry.
4. Get direct access to the HSF library using QtScript( ECMA/Javascript)using the ScriptWidget.
5
2 Boundary Representation
The Geometry in OpenShapeFactory is represented using Boundary Represen-tation, Boundary representation models are composed of two parts: topologyand 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 abounded piece of a curve and a vertex lies at a point. Other elements are theshell (a set of connected faces), the loop (a circuit of edges bounding a face) andloop-edge links (also known as winged edge links or half-edges) which are usedto create the edge circuits. The edges are like the edges of a table, bounding asurface 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 a3d surface right as shown on figure 2. the 2d surface is a diagrammatic panelwhere widgets are loaded, in the case of the precompiled download, a QScintillatext-editor widget with programmatic access to the openshapefactory is auto-matically 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 beimmediately 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 yourtouch 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(scrollwheel)
2. zoom : press control + holding down the left mouse button
3. orbit : press control + holding right mouse button
8
Part II
OpenShape Factory Commands
4 Sliders
4.1 getval(position,minval,maxval)
creates a slider in the front end of the scriptwidget, position is the order inwhich you would like to display the slider in the front end, if you specify 0 asthe position it will be the first.
Minvalue is the left limit of the slider, Maxvalue is the right limit of theslider
5 File System and Misc
5.1 getfile
Displays a filesystem dialog to locate a file and returns the filepath of the fileselected.
5.2 getfileonce(filenamepath)
same as getfile except forces the system to load the file only once, notice howcheck shows on the interface allowing the user to select whether they want torespect 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, noticehow check shows on the interface allowing the user to select whether they wantto 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 everyitem 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 speci-fied by filepath. if for instance you watch an igs file and that file is afterwardsmodified by Rhino or Catia, simply by overriding the file, the code in Open-Shapefactory will re-evaluate.
6 Viewport
6.1 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 visual-ized 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 thatis created and is not visualized will be created in memory, but will no show onthe viewport
Figure 5: Gaussian Curvature with the viscurvature command
7 Point Geometry
7.1 makepoint(x,y,z)
creates a point by the x y z coordinate note you must call the vis command andpass 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 ofunits 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 shouldbe a value from 0 to 1, 0 represents the start of the curve and 1 represents theend of the curve, for example 0.5 would be the middle of the curve.
8 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 valuesrequires a value between 0 and 1 on a parametrized surface.
if importing your geometry from rhino make sure to call the reparametrizecommand on the surface, and specify the start parameter as 0 and the endparameter 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 andv values requires a value between 0 and 1 on a parametrized surface.
if importing your geometry from rhino make sure to call the reparametrizecommand on the surface, and specify the start parameter as 0 and the endparameter as 1.
8.3 getcoord(point,subparmposition)
gets the subcoordinate value of a point, for example if you had a point named p1and you wanted to extract the z coordinate of the point you would so by callingthe function requesting the 3rd subcoordinate this way: z = getcoord(p1,3)
9 Vectors
9.1 makeuvvec(srf,u,v)
create a vector normal to the surface at the u and v coordinates, both the u andv values requires a value between 0 and 1 on a parametrized surface.
if importing your geometry from rhino make sure to call the reparametrizecommand on the surface, and specify the start parameter as 0 and the endparameter 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 percentageof 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 thevector located to the right of vector2
10 Planes
10.1 makeplane(point,vector)
create a plane by using a point to locate the centre of the plane and a vector torepresent 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 length1amounts 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 themakepointlist command and afterwards add the points using the addpointtolistcommand.
11.3.1 makebspline Example:
p1 = makepoint(0,0,0)
p2 = makepoint(10,0,30)
p3 = makepoint(10,10,30)
p4 = makepoint(0,10,0)
mypointlist = makepointlist()
mypointlist = addpointtolist(mypointlist,p1)
mypointlist = addpointtolist(mypointlist,p2)
mypointlist = addpointtolist(mypointlist,p3)
mypointlist = addpointtolist(mypointlist,p4)
mybspline = makebspline(mypointlist)
11.4 makecircle(point,vector,radius)
creates a circle from its center point , a vector determining its perpendiculardirection , 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 Surfaces
12.1 makefillsrf(shapelist)
Create Coons surface, this surface fills the content of a curve or series of curvesgiven by the list.
12.2 makeloft(shapelist)
Create a Loft surface that passes through a list of curves, specified as cross-sections
12.3 makeoffsetsurface(surface,offsetval)
Create an offset surface from the given surface using the offsetval as the amountof units you want the offset surface to be away from the original reference surface.
13 Import / Export
13.1 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 Lists
14.1 addpointtolist(pointlist,point)
Adds a point to a list, this list is issually referenced by a function such asmakebspline, 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 asmakeloft() 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 in-voke the addshapetolist(listname,objectotadd) in order to populate the list withshapes.
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 invokethe 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 Measure
15.1 getdistance(p1,p2)
calculate the distance between two points
16 Operations
16.1 makerotate(obj,vector,angle)
Rotate an object using the vector as the rotation axis and the angles as theamount 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 ofsymmetry
16.3 maketranslatebylength(obj,vector,distance)
Translate an object as many units specified in distance, in the direction of thevector specified.
17 Math
to invoke Math Functions call Math.functionname for the case of the hyperboliccosine we had to forward the c++ version to the script. for the case of thehyperbolic 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 utility
18.1 panelize(srf,u,v,panelfunc(p1,p2,p3,p4))
This function creates a grid scaffold around the surface, the function createsas many panels specified by the u and v parameters, the user must create apanelfunction 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 Debug
19.1 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 ExamplesIn this section we will introduce, examples to illustrate the use of OpenShape-
Factory.
20 Make a single Point
Type the following code in the code editor and see the geometry update as youtype.
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 youtype.
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 youtype.
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 acustom crossection using user defined functions, also populating panels on thesurface 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 asurface into rectangular regions, as many regions you want on the u direction ofthe surface, and as many regions you want on the v direction. on each region youwill 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 functionyou can do anything you want with those 4 points, the 4 points represent the 4corners 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 acrossthe overall surface, when in fact the effect is only being executed on a per panelbasis, have fun!.
when running this example make sure the x1 x2 x3 and x4 sliders are dis-tributed 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 theyare twisting in space the surface might not generate as nicely, the z value ofeach 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 = getval(3,minval,maxval)
y2 = getval(4,minval,maxval)
z2 = getval(5,0,maxval)
x3 = getval(6,minval,maxval)
y3 = getval(7,minval,maxval)
18
z3 = getval(8,0,maxval)
x4 = getval(9,minval,maxval)
y4 = getval(10,minval,maxval)
z4 = getval(11,0,maxval)
p1 = makepoint(x1,y1,0)
p2 = makepoint(x2,y2,0)
p3 = makepoint(x3,y3,0)
p4 = 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 = crossection(spline1,0,z1,z1)
crs2 = crossection(spline1,0.25,z2,z2)
crs3 = crossection(spline1,0.75,z3,z3)
crs4 = crossection(spline1,1,z4,z4)
loftlist= makeshapelist()
loftlist = addshapetolist(loftlist,crs1)
loftlist = addshapetolist(loftlist,crs2)
loftlist = addshapetolist(loftlist,crs3)
loftlist = addshapetolist(loftlist,crs4)
loft1 = 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 = makelineptdir(p1,up,0,height)
endpup = 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 = b /100
c2 = c /3 /100
for (i=0;i<ucount;i++) {
u = (upival/ ucount) * i
for (j=0;j<vcount;j++) {
v = (vpival / vcount) * j
x=a1 * Math.cos(u) * Math.sin(v)
y=b1 * Math.sin(u) * Math.sin(v)
z= c1 * Math.cos(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 sup-ported 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