Evaluate children.
SubObject with geometry methods
a) Provide access to resource file. This is used when the resource needs to be accessed as a file, such as an SQLite database or Excel file. Use getUrl when the resource needs to be accessed via a URL, such as STL and Textures. b) Download an URL to local file.
Object to post messages
SubObject with model methods
Handle for non-existant objects
Evaluate refchain, or model and ruleName. The following all return the same value, assuming the current root name is 'Table1':
"root.leg.height" // root converted to current root
"world.root.leg.height" // root converted to current root
"world.Table1.leg.height" // no conversion
"world.TableFromBefore.leg.height" // converted to current root
"Table1.leg.height" // world prepended
"leg.height" // world.Table1 prepended
SubObject with reflection methods
Performs a typeCheck operation.
Performs the update operation on model
Root model.
Get settings POJO. NOTE: pretty cheap operation. No need to cache.
Internal K4 symbols. Used to reference protected properties of Designs and Models. These are case-sensitive. You must use object[] notation. Currently supported:
K4 kernel version.
World model.
Returns the inverse cosine in degrees.
The value
Returns the inverse sine in degrees.
The value
Determines if not all Required params are supplied
Model to check on
Returns the arc tangent in degrees.
The rise/run value
Returns the signed arc tangent in degrees.
The rise
The run
Returns the cosine of the angle.
The angle in degrees.
Convert radians to degrees.
Radians
Degrees
Deliberately throw an error.
Error message
This concatenates a pair of strings, or a pair of arrays. This function should not be used in new code. It is intended to support translated source from earlier systems.
A string or array argument
A string or array argument
Returns a set of RuleDescriptors for all rules on model.
The instance
Returns the model definition for the given model as a JSON string.
The model to get the definition for.
Optional. Gives the result the name given, instead of its current name.
A string. Use JSON.parse(
Creates dir to use for outputs generation.
The dir name.
Generates filename to be used for outputs generation. The file itself is not created.
Pathname to be used for file generation.
Get URL for output pathname.
Pathname to local output file.
URL for the file.
Get URL for output pathname.
Pathname to local output file.
Promise with URL for the file.
The resource desired or URL
Returns true if model inherits from designName at any level
The model to test
The design name to look for
Returns true if pathname is for output file.
Returns true if url is for output file.
Returns Boolean promise, which is true if url is for output file.
Computes the Minimum Spanning Tree of the graph, which is returned in the form of ??
Returns the next higher instance of designName from this
The starting point
The design name to look for
Return the "next higher assembly" (ignoring the group level) for model
Model for which the real parent is wanted
Offsets a polygon as defined by a single loop of Points. This is a back-compatible simplified version of the Polygon.offset2 method, which supports multi-valued offset distances and different corner treatments. For new work, use that method instead.
Set of points to be offset. Treated as a closed loop.
Distance to offset (negative values offset "inward")
An array of point loops.
Converts an XY polygon (or polyline) to a CurveTo list. This simply ignores the Z coordinate of the points passed in; it does no transformation.
The XY points representing the polygon.
Convert degrees to radians.
Evaluate method.
Removes duplicates from an array, returning a new array.
The set to operate on
Function which determines the "key" for an object. Objects with the same key are considered identical. The default is the item itself.
Function which determines whether two "keys" match. The default is ===.
This method creates a three.js Color object. These are used by some Designs, such as PointCloud, but cannot be used directly by the standard color parameter of Render3Mixin. However, it can be used to translate from one color space, such as HSL, to hex, for use in the color parameter. See the example below.
The red component of the color, number between 0 and 1, inclusive. OR a string containing any color spec acceptable to CSS, such as HSL, a color name, hex, etc.
The green component of the color, number between 0 and 1, inclusive.
The blue component of the color, number between 0 and 1, inclusive.
Round n down to the nearest increment of inc. Rounds toward -Infinity. Increments always include zero.
the number to round
the increment size
Round n to the nearest increment of inc. Rounds up (toward +Infinity) when n is exactly in between two increments. Increments always include zero.
the number to round
the increment size
Round n up to the nearest increment of inc. Rounds toward +Infinity. Increments always include zero.
the number to round
the increment size
"Safely" evaluates a refChain. This means that it will not throw an exception if any part of the refChain is invalid, but it will still return an exception if the valid refChain creates one.
A refchain to a value, or a model
Optional rule to be evaluated (first arg must be a model)
undefined if any part of the chain is invalid. This cannot be distinguished from a rule returning undefined.
Performs a set difference on two arrays, returning a new array.
First set of objects
Second set of objects
Function which determines the "key" for an object. Objects with the same key are considered identical. The default is the item itself.
Function which determines whether two "keys" match. The default is ===.
Performs a set intersection on two arrays, returning a new array.
First set of objects
Second set of objects
Optional. Function which determines the "key" for an object. Objects with the same key are considered identical. The default is the item itself.
Optional. Function which determines whether two "keys" match. The default is ===.
Performs a set union on two arrays, returning a new array.
First set of objects
Second set of objects
Optional. Function which determines the "key" for an object. Objects with the same key are considered identical. The default is the item itself.
Optional. Function which determines whether two "keys" match. The default is ===.
Returns the sine of the angle.
The angle in degrees
Returns the tangent of the angle.
The angle in degrees.
Mass-transforms a set of points
The point set to be converted. May be Point[], or Point[][]
The transform to be applied
A new set of points that have been transformed.
Traverses the tree from start, and returns an array of all matching descendants. At each node in the tree, first the selector function is used to determine if this node should be collected, and then the rejector function is used to determine if the children of this node should be processed. UserData is supplied as the second argument to both functions, to allow passing in of addition information to the functions. If you are going to use userData, your function needs to be declared to take two arguments.
Note: This demands the tree, and will demand nodes that may not be completely working. It is up to the author to filter such nodes out (using the selector function), or write rules to ensure the tree is expandable.
The starting Model instance. Use "this" to start at the calling model.
The selection function. Should return true when a match is found.
Optional object which can be used to pass in more arguments. Default is {}
.
A function that determines whether to process the children. Should
return true
when the children of its argument should be processed. Default is
(node, userData) => true
.
Optional Boolean (defaulting to false) which will skip over errors while demanding the tree.
Returns a unique identifier. If a model is provided, the string is unique (not used as an identifier) within that context.
The string which will have an integer appended.
If supplied, the returned string is guaranteed to be unique in the given model.
The object R ("big R") is available in all Rules and Methods as a holder of most rule utility methods. It has several properties which hold topic-specific utilities:
To see these methods, click on the property, and then click on the sub-object type, such as RGeom under R.geom.