View source: R/rapt_cluster-sim.R
makecluster | R Documentation |
The makecluster
function simulates point clusters using two RCP point
clouds. The first point cloud is the "underlaying" pattern. This is the set
of points that will be used as actual cluster point locations in the final
product. The second point cloud is the "overlaying" pattern. This is the set
of points that will determine the positions of the clusters within the
underlaying pattern.
makecluster( under, over, radius1, radius2, type = "cr", ppc = NULL, cr = NULL, speed = "superfast", d = NULL, pic = 1, pcp = 0.06, den = 1, gb = FALSE, gbp = c(0, 1), gbmethod = "r", rb = FALSE, rbp = 1, rbmethod = 1, s = 100, toPlot = FALSE, showOverPts = FALSE )
under |
The underlaying RCP pattern. A |
over |
The overlaying RCP pattern. A |
radius1 |
The small radius of the underlaying RCP pattern. Can be found in the system output file, or as whatever the pattern is scaled to. |
radius2 |
The small radius of the overlaying RCP pattern. Can be found in the system output file, or as whatever the pattern is scaled to. |
type |
How to create the clusters. Either "ppc", "cr", or "dist". See below for more information on each. |
ppc |
Number of points per cluster if type = "ppc", otherwise NULL. |
cr |
Cluster radius if type = "cr", otherwise NULL. |
speed |
"slow", "fast", or "superfast" for type = "cr". |
d |
Distance between clusters if type = "dist", otherwise NULL. |
pic |
Percent In Clusters. Percent of the points marked as cluster type that should actually be contained within the clusters. Number between 0 and 1 For example, if pic = 0.5, 50 percent of the cluster type points will be in clusters and 50 percent will be randomly spread through the point cloud. |
pcp |
Percent Cluster Points. Percent of the points in the underlaying RCP pattern that should be marked as cluster type points. Number between 0 and 1. |
den |
Intra cluster density of cluster points. Number between 0 and 1.
Currently written for application to |
gb |
|
gbp |
Parameters for the cluster center gaussian blurs. |
gbmethod |
See |
rb |
|
rbp |
Parameters for the cluster radius blurs. If |
rbmethod |
Metod for distributing radius blur. |
s |
Seed for the random parts of the cluster generation process. |
toPlot |
Show a 3D plot of the cluster points once generation is done? TRUE or FALSE. |
showOverPts |
If toPlot = TRUE, show all of the points in the RCP pattern, with clustered points marked in red, or just show the clustered points? TRUE or FALSE. |
Hello friends. A quick update as of 11/8/18; I have added quite a few features and upgrades to this function, but mostly just to the cr superfast type. It should be fairly easy to generalize these upgrades to the other types, but I haven't gotten around to it yet. Some time soon perhaps. Let me, Galen Vincent, know if you need some upgrades sooner. Thanks!
Returns are different based on type
.
type
= "ppc" or "dist"List of: [1]
pp3
object containing the cluster marked point
locations. [2] pp3
object containing the
overlaying RCP pattern after scaling. [3] Numeric vector containing: 1
points per cluster 1 2 number of points with points per cluster 1 3
points per cluster 2 4 number of points with points per cluster 2.
type
= "cr", speed = "slow"List of: [1]
pp3
object containing the cluster marked point
locations. [2] pp3
object containing the
overlaying RCP pattern after scaling. [3] Numeric vector containing: 1
number of clusters 2 number of points in those clusters.
type
= "cr", speed = "fast"List of: [1]
pp3
object containing the cluster marked point
locations. [2] pp3
object containing the
overlaying RCP pattern after scaling. [3] factor containing the number of
points in each cluster.
type
= "cr", speed = "superfast", rb = FALSEList of:
[1] pp3
object containing the cluster marked
point locations. [2] pp3
object containing the
overlaying RCP pattern after scaling. [3] number of points put in or
taken away at random. [4] Vector of nearest neighbor distance (cluster
center to center) from each cluster
type
= "cr", speed = "superfast", rb = TRUEList of:
[1] pp3
object containing the cluster marked
point locations. [2] pp3
object containing the
overlaying RCP pattern after scaling. [3] number of points put in or
taken away at random. [4] Vector of nearest neighbor distance (cluster
center to center) from each cluster. [5] A vector contining the radius of
each cluster.
What the different arguments for
type
argument mean.
Specify the number of points that should be in each cluster. Needs to be
paired with the ppc
argument The program will scale the overlaying
pattern so that there are approximately the correct number of clusters
placed through the underlaying patten, mark the n closest points to these
cluster centers as cluster points, where n is the value input to the ppc
argument. The cluster centers are defined by the point locations of the
scaled overlaying RCP pattern. At this point, there should be approximately
N x pcp
x pip
points containined in clusters (N = total
points in the underlaying RCP pattern). The method cleans up by marking or
removing marks around the centers as necesary so that there are exactly N x
pcp x pip points in clusters. The rest of the N x pcp
x
(1-pip
) points are then placed randomly through the remaining
non-cluster-marked points.
Specify the radius of the clusters. Needs to be paried with the cr
argument. The overlaying RCP pattern will be scaled so that there are
approximately the correct number of clusters placed through the underlaying
pattern. All points in the underlaying pattern within distance cr
of
the cluster centers are marked as cluster points. The cluster centers are
defined by the point locations of the scaled overlaying RCP pattern. At
this point, there should be approximately N x pcp
x pip
points containined in clusters (N = total points in the underlaying RCP
pattern). The method cleans up by marking or removing marks around the
centers as necesary so that there are exactly N x pcp x pip points in
clusters. The rest of the N x pcp
x (1-pip
) points are then
placed randomly through the remaining non-cluster-marked points.
speed = "slow"
gives the most accurate, but slowest realization.
speed = "fast"
gives the second fastest, but less accurate
realization (fails with large data sets). Clusters may not be 100\
with points. speed = "superfast"
gives the fastest, but least
accurate realization (works well with large data sets). Clusters may not be
100\
through the pattern.
Specify the distance between clusters. Needs to be paired with the d
argument. The overlaying RCP pattern will be scaled according to the
d
argumnet so that the small radius of the overlaying RCP pattern is
d
/2. Selects the closest n points around each cluster center so that
there are N x pcp
x pip
points contained in clusters. The
rest of the N x pcp
x (1-pip
) points are then placed randomly
through the remaining non-cluster-marked points.
Other simulation functions:
clustersim()
,
lattice()
,
morph_lamellar()
,
morph_rods()
,
nmers()
,
read.rcp()
,
scaleRCP()
,
stitch.size()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.