public class TLcd3DTilesProcessorBuilder extends Object
create a builder
, add one or more input files
and an output path
and
start to process
. This returns a Future
.
return TLcd3DTilesProcessorBuilder.newBuilder()
.addInputFiles("path/to/input/folder/mesh.obj")
.outputPath("path/to/output/folder/")
.process()
.get();
ILcdModelReferenceDecoder
. The default reference decoder set on this
builder is based on all model reference decoders annotated with the LcdService
annotation, and can handle:
<filename>.epsg
): see TLcdEPSGModelReferenceDecoder
for more info.<filename>.prj
): see TLcdWKTModelReferenceDecoder
for more info.<filename>.ref
): see TLcdModelReferenceDecoder
for more info.-Xmx
argument to set a maximum heap size of 8 gigabytes. That should be enough to handle most datasets.
You also need to consider the required hard drive space.
During the mesh conversion process, temporary files may be stored on the hard drive in a folder named cache
. You can find it at
the location from which you are running the process. The hard drive cache may grow to up to twice the size of the
original dataset.
On top of that, you need to make sure that the hard drive has enough space available for the processed tileset.
When it is ready for streaming, the processed dataset may have up to
three times the original size in some cases.
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_TEXTURE_SIZE_PER_TILE
Default value of the texture size.
|
static int |
DEFAULT_VERTEX_COUNT_PER_TILE
Default value for the vertex count.
|
Modifier and Type | Method and Description |
---|---|
TLcd3DTilesProcessorBuilder |
addInputFiles(String... aMeshPath)
Adds paths pointing to a single file in a supported mesh format.
|
TLcd3DTilesProcessorBuilder |
defaultModelReference(ILcdModelReference aModelReference)
Set a unique reference to be used for all the meshes.
|
TLcd3DTilesProcessorBuilder |
dropSmallComplexParts(boolean aDropSmallComplexParts)
Drop parts of the mesh that are relatively small and complex before simplification.
|
TLcd3DTilesProcessorBuilder |
forcePNGEncoding(boolean aForcePNGEncoding)
Forces
png encoding for textures. |
TLcd3DTilesProcessorBuilder |
globalShift(ILcdPoint aGlobalShift)
Set a global shift to be used for every mesh.
|
TLcd3DTilesProcessorBuilder |
globalShiftFactory(Function<String,ILcdPoint> aGlobalShiftFactory)
Set a global shift factory that returns a
point for a given file. |
TLcd3DTilesProcessorBuilder |
meshCompression(ELcdOGC3DTilesMeshCompressionType aMeshCompressionType)
Sets the mesh compression algorithm to use in the OGC 3D Tiles encoding.
|
TLcd3DTilesProcessorBuilder |
metadataMapper(ILcd3DTilesProcessorMetadataMapper aMetadataMapper)
Adds a metadata provider to this builder.
|
TLcd3DTilesProcessorBuilder |
modelReferenceDecoder(ILcdModelReferenceDecoder aModelReferenceDecoder)
Set a model reference decoder that returns a reference for a given filepath.
|
static TLcd3DTilesProcessorBuilder |
newBuilder()
Creates a new builder for the 3DTiles processor.
|
TLcd3DTilesProcessorBuilder |
outputPath(String aOutputPath)
Set the folder that the output OGC 3D Tiles tileset is written to.
|
TLcd3DTilesProcessorBuilder |
preserveBorders(boolean aPreserveBorders)
The border of a mesh consists of edges that only connect to a single face.
|
Future<Void> |
process()
Starts the OGC 3D Tiles processing.
|
TLcd3DTilesProcessorBuilder |
simplificationStrategy(ELcdSimplificationStrategy aSimplificationStrategy)
Specifies the simplification algorithm to use.
|
TLcd3DTilesProcessorBuilder |
statusListener(ILcdStatusListener aStatusListener)
Set the status listener to be notified of the task's progress.
|
TLcd3DTilesProcessorBuilder |
textureQuality(float aTextureQuality)
Set the
jpeg encoding quality. |
TLcd3DTilesProcessorBuilder |
textureSize(int aTextureSize)
Sets the texture size per tile.
|
TLcd3DTilesProcessorBuilder |
textureToColor(boolean aTextureToColor)
Specifies whether this model's textures should be converted to color.
|
TLcd3DTilesProcessorBuilder |
verticesPerTile(int aVerticesPerTile)
Sets the number of vertices per tile.
|
public static final int DEFAULT_TEXTURE_SIZE_PER_TILE
textureSize(int)
.public static final int DEFAULT_VERTEX_COUNT_PER_TILE
verticesPerTile(int)
.public static TLcd3DTilesProcessorBuilder newBuilder()
public TLcd3DTilesProcessorBuilder addInputFiles(String... aMeshPath)
aMeshPath
- One or more paths to files containing mesh data.public TLcd3DTilesProcessorBuilder textureSize(int aTextureSize)
verticesPerTile(int)
parameter and should be left to default for most purpose.aTextureSize
- the squared root of the texture size per tile. A value of 256 results in 256 x 256 textures.
Defaults to 1024.public TLcd3DTilesProcessorBuilder verticesPerTile(int aVerticesPerTile)
textureSize(int)
parameter and should be left to default for most purpose.aVerticesPerTile
- the number of vertices per tile. Defaults to 15000.public TLcd3DTilesProcessorBuilder dropSmallComplexParts(boolean aDropSmallComplexParts)
aDropSmallComplexParts
- true if the strategy should be used, true by default.public TLcd3DTilesProcessorBuilder metadataMapper(ILcd3DTilesProcessorMetadataMapper aMetadataMapper)
aMetadataMapper
- A metadata providerILcd3DTilesProcessorMetadataMapper
,
TLcd3DTilesProcessorDataTypes
public TLcd3DTilesProcessorBuilder preserveBorders(boolean aPreserveBorders)
Use this when you see holes in the resulting 3DTiles or when meshes are badly distorted near their borders, e.g: the base of a building.
aPreserveBorders
- true if should preserve borders, false by default.public TLcd3DTilesProcessorBuilder statusListener(ILcdStatusListener aStatusListener)
aStatusListener
- a status listener.public TLcd3DTilesProcessorBuilder textureToColor(boolean aTextureToColor)
Specifies whether this model's textures should be converted to color.
If true, the material's diffuse textures will be converted to a diffuse color that is the average color of the texture. This is useful for models that have many repeating textures (with texture coordinates outside [0, 1]). Rather than tiling deep in order to preserve the detail of the textures, switching to color will greatly improve performance and give a more cartoonish appearance to the tileset.
This option is intended for models that consist of many small textures. If the model has a single, large texture atlas, the result is a model with a single color.
aTextureToColor
- true if texture should be converted to colorpublic TLcd3DTilesProcessorBuilder simplificationStrategy(ELcdSimplificationStrategy aSimplificationStrategy)
QUADRIC_EDGE_COLLAPSE
.aSimplificationStrategy
- the simplification algorithm to use.public TLcd3DTilesProcessorBuilder outputPath(String aOutputPath)
aOutputPath
- the output pathpublic TLcd3DTilesProcessorBuilder forcePNGEncoding(boolean aForcePNGEncoding)
png
encoding for textures.
By default, jpeg
is used for textured meshes and png
is used for colored meshes.
In the case of meshes that are both textured and colored, for example when building roofs are textured, but the
walls are of a single color, it is recommended to encode the entire texture atlas to png
. This will result in
heavier tiles but it will prevent jpeg
color artifacts.aForcePNGEncoding
- true if textures should be forced encoded to png
public TLcd3DTilesProcessorBuilder meshCompression(ELcdOGC3DTilesMeshCompressionType aMeshCompressionType)
aMeshCompressionType
- The mesh compression you want to use (default: DRACO); Should not be null
.public TLcd3DTilesProcessorBuilder textureQuality(float aTextureQuality)
Set the jpeg
encoding quality.
Setting this option to a low value reduces the size of the individual output tiles, and results in typical JPEG encoding artifacts (the image below shows an example of those typical JPEG artifacts). For most cases, we recommend that you keep the default texture quality value.
Default is 0.7
. Typically, there's no need to go above 0.9
.
This method has no effect when forcePNGEncoding(boolean)
is active.
aTextureQuality
- a quality between 0 (low quality) and 1 (high quality).public TLcd3DTilesProcessorBuilder globalShiftFactory(Function<String,ILcdPoint> aGlobalShiftFactory)
point
for a given file.
The global shift is applied in the same reference that the mesh is defined in.
If the factory returns null for a particular file, the global shift set with
globalShift(com.luciad.shape.ILcdPoint)
will be used.
If the global shift has not been set,
the process will attempt to read the global shift from an ".xyz" file with the same name as the mesh file.
This must be a small text file with a single line containing three doubles: <x> <y> <z>
.aGlobalShiftFactory
- the factorypublic TLcd3DTilesProcessorBuilder globalShift(ILcdPoint aGlobalShift)
globalShiftFactory(java.util.function.Function<java.lang.String, com.luciad.shape.ILcdPoint>)
for details.aGlobalShift
- the shiftpublic TLcd3DTilesProcessorBuilder modelReferenceDecoder(ILcdModelReferenceDecoder aModelReferenceDecoder)
.prj
, .epgs
or .ref
files with the same name as the meshes are automatically picked-up.aModelReferenceDecoder
- a reference decoderpublic TLcd3DTilesProcessorBuilder defaultModelReference(ILcdModelReference aModelReference)
model reference decoder
.
If the model reference decoder returns null, and the default reference is also null, then the resulting tileset is not referenced.aModelReference
- the reference