This is an automated email from the ASF dual-hosted git repository.

asf-gitbox-commits pushed a commit to branch geoapi-4.0
in repository https://gitbox.apache.org/repos/asf/sis.git


The following commit(s) were added to refs/heads/geoapi-4.0 by this push:
     new d58331b2aa feat(Geometry): prepare scene physics package
d58331b2aa is described below

commit d58331b2aa44036192c466ab87f63bad5af5dbae
Author: jsorel <[email protected]>
AuthorDate: Sun May 3 00:53:40 2026 +0200

    feat(Geometry): prepare scene physics package
---
 .../apache/sis/geometries/OrientedGeometry.java    | 57 ++++++++++++++++++++++
 .../main/org/apache/sis/geometries/Sphere.java     |  7 ++-
 .../sis/geometries/scene/physics/package-info.java | 27 ++++++++++
 3 files changed, 87 insertions(+), 4 deletions(-)

diff --git 
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/OrientedGeometry.java
 
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/OrientedGeometry.java
new file mode 100644
index 0000000000..8ae57d78a6
--- /dev/null
+++ 
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/OrientedGeometry.java
@@ -0,0 +1,57 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sis.geometries;
+
+import org.apache.sis.geometries.math.Similarity;
+import org.opengis.geometry.Envelope;
+
+
+/**
+ * An oriented geometry is a geometry with specific properties
+ * and additional rotation,translation properties.
+ * <p>
+ * Oriented geometries are often the base class of named geometries which 
contain curves,
+ * like sphere or cylinders, but alos any non basic shapes which can be 
defined by self-defined properties
+ * like height/width/radius and a separate point and orientation.
+ * <p>
+ * TODO : oriented geometries includes :
+ * - infinite plane
+ * - finite plane, also called Quad
+ * - cylinder with varying top/bottom radius
+ * - cone whih is a 0 radius cylinder
+ * - capsule  (cylinder with hemispherical ends), with varying top/bottom 
radius
+ * - sphere
+ * - ellipsoid
+ *
+ * @author Johann Sorel
+ */
+public interface OrientedGeometry extends Geometry {
+
+    /**
+     * Get geometry transform.
+     * @return Similarity, never null
+     */
+    Similarity<?> getTransform();
+
+    /**
+     * Get the geometry envelope without the orientation rotation and 
translation
+     * applied.
+     * @return Envelope
+     */
+    Envelope getUnorientedEnvelope();
+
+}
diff --git 
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/Sphere.java
 
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/Sphere.java
index e747b844d9..585a0bb44c 100644
--- 
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/Sphere.java
+++ 
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/Sphere.java
@@ -26,7 +26,6 @@ import 
org.apache.sis.geometries.internal.shared.AbstractGeometry;
 import org.apache.sis.geometries.math.Tuple;
 import org.apache.sis.geometries.math.Vector;
 import org.apache.sis.geometries.math.Vectors;
-import org.apache.sis.geometry.GeneralEnvelope;
 import org.apache.sis.util.ArgumentChecks;
 
 // Specific to the geoapi-4.0 branch:
@@ -43,7 +42,7 @@ import org.opengis.metadata.Identifier;
 @UML(identifier="Sphere", specification=ISO_19107) // section 8.5.2
 public final class Sphere extends AbstractGeometry implements 
ParametricCurveSurface {
 
-    private Tuple center;
+    private Tuple<?> center;
     private double radius = 1.0;
 
     /**
@@ -108,7 +107,7 @@ public final class Sphere extends AbstractGeometry 
implements ParametricCurveSur
     /**
      * @return sphere center, modifiable.
      */
-    public Tuple getCenter() {
+    public Tuple<?> getCenter() {
         return center;
     }
 
@@ -117,7 +116,7 @@ public final class Sphere extends AbstractGeometry 
implements ParametricCurveSur
      */
     @Override
     public Envelope getEnvelope() {
-        final Tuple center = getCenter();
+        final Tuple<?> center = getCenter();
         final BBox env = new BBox(center, center);
         env.setCoordinateReferenceSystem(getCoordinateReferenceSystem());
         if (radius > 0) {
diff --git 
a/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/scene/physics/package-info.java
 
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/scene/physics/package-info.java
new file mode 100644
index 0000000000..9f98ca73f5
--- /dev/null
+++ 
b/incubator/src/org.apache.sis.geometry/main/org/apache/sis/geometries/scene/physics/package-info.java
@@ -0,0 +1,27 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/**
+ * This package contains physical model description, also called Rigid-Bodies.
+ *
+ * Based on specifications :
+ * <ul>
+ * <li>Khronos GLTF-2 : KHR_implicit_shapes 
https://github.com/eoineoineoin/glTF_Physics/tree/master/extensions/2.0/Khronos/KHR_implicit_shapes</li>
+ * <li>Khronos GLTF-2 : KHR_physics_rigid_bodies 
https://github.com/eoineoineoin/glTF_Physics/tree/master/extensions/2.0/Khronos/KHR_physics_rigid_bodies</li>
+ * </ul>
+ */
+package org.apache.sis.geometries.scene.physics;

Reply via email to