CCentroid:new
The new method constructs a new instance of a CCentroid object. The CCentroid class includes properties that control calculation of centroid positions. Two different constructor overloads are available to create a new CCentroid and initialize the properties.
C = CCentroid:new()
C = CCentroid:new( CCentroid2 )
|
Two overloads are provided for the CCentroid class. They create a default CCentroid and a copy of a CCentroid. If you pass something other than nil or another CCentroid—such as a string—then the default constructor is used.
The following script fragment illustrates using the 2 constructors. All produce the same result:
|
-- create CCentroid C1 and set values |
|
-- change the default sign |
|
-- copy C1 to a new CCentroid C2 |
|
-- result: C1 sign = 0 |
|
-- result: C2 sign = 0 |