Skip to content

Commit

Permalink
Merge pull request #17 from Gaia3D/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
znkim committed Jun 5, 2024
2 parents 8602231 + 0b51143 commit dc7f860
Show file tree
Hide file tree
Showing 58 changed files with 1,715 additions and 723 deletions.
31 changes: 21 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ usage: Gaia3D Tiler
gltf, glb, las, laz, citygml, indoorgml,
shp, geojson)(Default: kml)
-l,--log <arg> Output log file path.
-mc,--multiThreadCount <arg> Multi-Thread count (Default: 4)
-lm,--largeMesh [Experimental] Large Mesh Splitting Mode
(Default: false)
-mc,--multiThreadCount <arg> set Multi-Thread count
-mg,--maxGeometricError <arg> Maximum geometric error (Default: Integer
max value)
-mh,--minimumHeight <arg> Minimum height value for extrusion model
Expand All @@ -79,15 +81,19 @@ usage: Gaia3D Tiler
-q,--quiet Quiet mode/Silent mode
-r,--recursive Tree directory deep navigation.
-ra,--refineAdd Set 3D Tiles Refine 'ADD' mode
-rc,--radiusColumn <arg> Radius column setting for extrusion model
(Default: radius)
-ru,--flipUpAxis Rotate the matrix 180 degrees about the
X-axis. (Default: false)
-sh,--skirtHeight <arg> Building Skirt height setting for
extrusion model (Default: 4.0)
-su,--swapUpAxis Rotate the matrix -90 degrees about the
X-axis. (Default: false)
-te,--terrain <arg> GeoTiff Terrain file path, 3D Object
applied as clampToGround (Supports
geotiff format)
-v,--version Print Version Info
-xl,--maxLod <arg> Max Level of detail (Default: 3)
-ya,--yUpAxis Assign 3D root transformed matrix Y-UP
axis
-zo,--zeroOrigin [Experimental] fix 3d root transformed
matrix origin to zero point.
```
Expand All @@ -108,7 +114,7 @@ Example usage :
docker pull gaia3d/mago-3d-tiler
```
```
docker run --rm -v "/workspace:/workspace" gaia3d/mago-3d-tiler -it 3ds -i /workspace/3ds-samples -o /workspace/sample-3d-tiles -crs 5186 -aa
docker run --rm -v "/workspace:/workspace" gaia3d/mago-3d-tiler -it 3ds -i /workspace/3ds-samples -o /workspace/sample-3d-tiles -crs 5186
```

### Supported Java versions:
Expand Down Expand Up @@ -160,8 +166,7 @@ mago 3DTiler는 Java 기반으로 뛰어난 이식성, 유연함과 함께 빠
- mago-3d-tiler-x.x.x-natives-windows.jar
- mago-3d-tiler-x.x.x-natives-linux.jar
- mago-3d-tiler-x.x.x-natives-macos.jar

빌드할 사용된 java 버전은 jdk 17 입니다.
빌드 시 사용된 java 버전은 jdk 17 입니다.

아래는 Help 코드를 실행시킨 예시입니다.
```
Expand Down Expand Up @@ -196,7 +201,9 @@ usage: Gaia3D Tiler
gltf, glb, las, laz, citygml, indoorgml,
shp, geojson)(Default: kml)
-l,--log <arg> Output log file path.
-mc,--multiThreadCount <arg> Multi-Thread count (Default: 4)
-lm,--largeMesh [Experimental] Large Mesh Splitting Mode
(Default: false)
-mc,--multiThreadCount <arg> set Multi-Thread count
-mg,--maxGeometricError <arg> Maximum geometric error (Default: Integer
max value)
-mh,--minimumHeight <arg> Minimum height value for extrusion model
Expand All @@ -219,15 +226,19 @@ usage: Gaia3D Tiler
-q,--quiet Quiet mode/Silent mode
-r,--recursive Tree directory deep navigation.
-ra,--refineAdd Set 3D Tiles Refine 'ADD' mode
-rc,--radiusColumn <arg> Radius column setting for extrusion model
(Default: radius)
-ru,--flipUpAxis Rotate the matrix 180 degrees about the
X-axis. (Default: false)
-sh,--skirtHeight <arg> Building Skirt height setting for
extrusion model (Default: 4.0)
-su,--swapUpAxis Rotate the matrix -90 degrees about the
X-axis. (Default: false)
-te,--terrain <arg> GeoTiff Terrain file path, 3D Object
applied as clampToGround (Supports
geotiff format)
-v,--version Print Version Info
-xl,--maxLod <arg> Max Level of detail (Default: 3)
-ya,--yUpAxis Assign 3D root transformed matrix Y-UP
axis
-zo,--zeroOrigin [Experimental] fix 3d root transformed
matrix origin to zero point.
```
Expand All @@ -249,7 +260,7 @@ mago 3DTiler 1.3.1 버전부터 도커 버전으로 손쉽게 사용할 수 있
docker pull gaia3d/mago-3d-tiler
```
```
docker run --rm -v "/workspace:/workspace" gaia3d/mago-3d-tiler -it 3ds -i /workspace/3ds-samples -o /workspace/sample-3d-tiles -crs 5186 -aa
docker run --rm -v "/workspace:/workspace" gaia3d/mago-3d-tiler -it 3ds -i /workspace/3ds-samples -o /workspace/sample-3d-tiles -crs 5186
```

### 지원하는 자바 버전:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,10 @@ public GaiaPrimitive toPrimitive() {
indicesInt[i] = indices[i];
}
face.setIndices(indicesInt);
surface.setFaces(new ArrayList<GaiaFace>() {{
surface.setFaces(new ArrayList<>() {{
add(face);
}});
primitive.setSurfaces(new ArrayList<GaiaSurface>() {{
primitive.setSurfaces(new ArrayList<>() {{
add(surface);
}});
////primitive.setIndices(indices); // old. indices are now in faces of surface of the primitive
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,12 @@ private GaiaRectangle calcTexcoordBoundingRectangle(GaiaBufferDataSet bufferData
public void translate(Vector3d translation) {
for (GaiaBufferDataSet bufferData : this.bufferDatas) {
GaiaBuffer positionBuffer = bufferData.getBuffers().get(AttributeType.POSITION);

if (positionBuffer == null) {
log.error("Position buffer is null");
return;
}

float[] positions = positionBuffer.getFloats();
for (int i = 0; i < positions.length; i += 3) {
positions[i] += (float) translation.x;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ public class TNetwork {
private List<TEdge> edges;

public TNetwork() {
nodes = new ArrayList<TNode>();
edges = new ArrayList<TEdge>();
nodes = new ArrayList<>();
edges = new ArrayList<>();
}

public void makeTEdgesListForTNodes() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,8 @@ public class TNode {
// a pipe pump, a pipe tank, a pipe reservoir, a pipe junction, a pipe source, a pipe sink, a pipe pipe, etc.
private int id = -1;
private String guid = "";
@Setter
@Getter
private Vector3d position;
private List<TEdge> edges = new ArrayList<TEdge>();
private List<TEdge> edges = new ArrayList<>();

public TNode() {
position = new Vector3d();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -497,8 +497,8 @@ public void tessellate2D(Polygon2DTess polygon2D, List<Polygon2DTess> resultConv
getPointsIdxSortedByDistToPoint(pointA, polygon2D.getPoints(), sortedIndices);

int sortedIndicesCount = sortedIndices.size();
for (int j = 0; j < sortedIndicesCount; j++) {
idxB = sortedIndices.get(j);
for (Integer sortedIndex : sortedIndices) {
idxB = sortedIndex;
if (idxA == idxB) {
// skip the same point.***
continue;
Expand All @@ -511,8 +511,7 @@ public void tessellate2D(Polygon2DTess polygon2D, List<Polygon2DTess> resultConv

Point2DTess pointB = polygon2D.getPoint(idxB);
Segment2DTess segment = new Segment2DTess(pointA, pointB);
if(segment.getLengthSquared() < error)
{
if (segment.getLengthSquared() < error) {
// the segment is too short.***
continue;
}
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,16 @@ public float calculateNormal2D(List<Integer> resultConcaveIndices) {

double angRad = Math.acos(dot); // because v1 and v2 are normalized.***
normal += (float) (angRad * cross);

// TODO: check if this is necessary.***
if (Math.abs(normal) < 1e-5) {
normal = 0.0f;
return normal;
}
}

if(Math.abs(normal) < 1e-5) // 1e-6 works ok.***
{
if (Math.abs(normal) < 1e-5) {
// 1e-6 works ok.***
// probably the polygon is a line, or a self-intersecting polygon (butterfly polygon).***
normal = 0.0f;
return normal;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,7 @@ public class GaiaMaterial implements Serializable {
private Map<TextureType, List<GaiaTexture>> textures = new WeakHashMap<>();
private boolean isRepeat = false;

public boolean isOpaqueMaterial()
{
public boolean isOpaqueMaterial() {
boolean isOpaque = true;

// 1rst check textures.***
Expand Down Expand Up @@ -71,60 +70,6 @@ public boolean isOpaqueMaterial()
return isOpaque;
}

/*public static boolean areEqualMaterials(GaiaMaterial materialA, GaiaMaterial materialB, float scaleFactor) {
// This function determines if two materials are equal.
if (materialA == null && materialB == null) {
return true;
} else if (materialA == null || materialB == null) {
return false;
}
if (materialA == materialB) {
return true;
}
Map<TextureType, List<GaiaTexture>> textureMapA = materialA.getTextures();
Set<TextureType> keys = textureMapA.keySet();
boolean hasTexture = false;
boolean hasTextureAreEquals = true;
for (TextureType key : keys) {
List<GaiaTexture> listTexturesA = textureMapA.get(key);
List<GaiaTexture> listTexturesB = materialB.getTextures().get(key);
if (listTexturesA == null && listTexturesB == null) {
continue;
} else if (listTexturesA == null || listTexturesB == null) {
hasTextureAreEquals = false;
}
if (listTexturesA.size() != listTexturesB.size()) {
hasTextureAreEquals = false;
}
for (int i = 0; i < listTexturesA.size() && i < listTexturesB.size(); i++) {
GaiaTexture textureA = listTexturesA.get(i);
GaiaTexture textureB = listTexturesB.get(i);
hasTexture = true;
// check if the fullPath of the textures are equal.***
String fullPathA = textureA.getFullPath();
String fullPathB = textureB.getFullPath();
if (fullPathA.equals(fullPathB)) {
hasTextureAreEquals = true;
} else if (!textureA.isEqualTexture(textureB, scaleFactor)) {
hasTextureAreEquals = false;
}
}
}
if (!hasTexture) {
Vector4d colorA = materialA.getDiffuseColor();
Vector4d colorB = materialB.getDiffuseColor();
return colorA.equals(colorB);
}
return hasTextureAreEquals;
}*/

public void write(BigEndianDataOutputStream stream) throws IOException {
stream.writeInt(id);
stream.writeText(name);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ public GaiaBoundingBox getBoundingBox(Matrix4d transform) {
GaiaBoundingBox boundingBox = new GaiaBoundingBox();
for (GaiaVertex vertex : vertices) {
Vector3d position = vertex.getPosition();

Vector3d transformedPosition = new Vector3d(position);
if (transform != null) {
transform.transformPosition(position, transformedPosition);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
@NoArgsConstructor
@AllArgsConstructor
public class GaiaSurface implements Serializable {
private ArrayList<GaiaFace> faces = new ArrayList<>();
private List<GaiaFace> faces = new ArrayList<>();

public void calculateNormal(List<GaiaVertex> vertices) {
for (GaiaFace face : faces) {
Expand Down
9 changes: 3 additions & 6 deletions common/src/main/java/com/gaia3d/basic/types/FormatType.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@
* Each format has a corresponding extension.
* The extension is used to determine the type of the file.
* The extension is also used to determine the type of the file that is being downloaded.
* @Author znkim
* @Since 1.0.1
* @See GaiaSet
*/
@Getter
@RequiredArgsConstructor
Expand All @@ -24,7 +21,7 @@ public enum FormatType {
COLLADA("dae", "dae", true),
MAX_3DS("3ds", "3ds",false),
MAX_ASE("ase", "ase", false),
FBX("fbx", "fbx", true),
FBX("fbx", "fbx", false),
OBJ("obj","obj", false),
IFC("ifc", "ifc",false),
CITYGML("gml","xml", false),
Expand Down Expand Up @@ -56,8 +53,8 @@ public static FormatType fromExtension(String extension) {
return Arrays.stream(FormatType.values())
.filter((type) -> {
boolean compareName = type.name().equalsIgnoreCase(extension);
boolean compareExtension = type.getExtension().equals(extension.toLowerCase());
boolean compareSubExtension = type.getSubExtension().equals(extension.toLowerCase());
boolean compareExtension = type.getExtension().equalsIgnoreCase(extension.toLowerCase());
boolean compareSubExtension = type.getSubExtension().equalsIgnoreCase(extension.toLowerCase());
return compareName || compareExtension || compareSubExtension;
})
.findFirst()
Expand Down
Loading

0 comments on commit dc7f860

Please sign in to comment.