Skip to content

Commit

Permalink
4.26.0-prerelease3
Browse files Browse the repository at this point in the history
  • Loading branch information
LauraFritz14 committed Nov 21, 2024
1 parent 0fc2902 commit c7a3741
Show file tree
Hide file tree
Showing 13 changed files with 96 additions and 52 deletions.
6 changes: 6 additions & 0 deletions PRODUCT_RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## 4.26.0-prerelease3
- surface priority tested
- trajectories visibility priorities fixes
- trajectories line width adjustable
- bugfix: #439 surface jumping fixed by use of pivot

## 4.26.0-prerelease1
- fixed surface priority
- improved handling of large trajectories
Expand Down
6 changes: 6 additions & 0 deletions TEST_RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## 4.26.0-prerelease3
- surface priority tested
- trajectories visibility priorities fixes
- trajectories line width adjustable
- bugfix: #439 surface jumping fixed by use of pivot

## 4.26.0-prerelease2
- fixed surface priority
- improved handling of large trajectories
Expand Down
8 changes: 4 additions & 4 deletions aardium/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "PRo3D",
"productName": "PRo3D.Viewer",
"version": "4.26.0-prerelease1",
"version": "4.26.0-prerelease3",
"description": "PRo3D, short for Planetary Robotics 3D Viewer, is an interactive 3D visualization tool to allow planetary scientists to work with high-resolution 3D reconstructions of the Martian surface.",
"license": "AGPL",
"copyright": "VRVis Zentrum für Virtual Reality und Visualisierung Forschungs-GmbH",
Expand All @@ -20,7 +20,7 @@
"dist:darwin:arm64": "bash ./signbuild.sh && electron-builder --c.buildVersion=$BUILD_VERSION --c.artifactName='${productName}-${buildVersion}-${arch}.${ext}' --publish always",
"dist::win32": "electron-builder --c.buildVersion='%BUILD_VERSION%' --c.artifactName='${productName}-${buildVersion}-${arch}.${ext}' --publish always",
"dist:linux:x64": "electron-builder --c.buildVersion=$BUILD_VERSION --c.artifactName='${productName}-${buildVersion}-${arch}.${ext}' --publish always"
},
},
"main": "main.js",
"repository": "https://github.com/electron/electron-quick-start",
"dependencies": {
Expand All @@ -31,7 +31,7 @@
"node-shared-mem": "1.0.12",
"nodejs-websocket": "^1.7.2"
},
"devDependencies": {
"devDependencies": {
"dotenv": "^16.0.0",
"electron": "^18.1.0",
"electron-builder": "^23.0.3",
Expand All @@ -48,7 +48,7 @@
"win": {
"icon": "build/icon.ico",
"target": "nsis"
},
},
"nsis": {
"installerIcon": "build/icon.ico",
"installerHeaderIcon": "build/icon.ico",
Expand Down
2 changes: 1 addition & 1 deletion src/PRo3D.Core/Drawing/Drawing.Sg.fs
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,7 @@ module Sg =
|> IndexedGeometryPrimitives.lines
|> Sg.ofIndexedGeometry
|> Sg.uniform "LineWidth" (AVal.constant width)
|> Sg.uniform "DepthOffset" (AVal.constant 0.0001)
|> Sg.uniform "DepthOffset"(AVal.constant 0.0000000001)
|> Sg.blendMode (AVal.constant BlendMode.None)
|> Sg.effect [
toEffect Aardvark.UI.Trafos.Shader.stableTrafo
Expand Down
18 changes: 17 additions & 1 deletion src/PRo3D.Core/Surface-Model.fs
Original file line number Diff line number Diff line change
Expand Up @@ -594,6 +594,22 @@ module Init =
z = { translationInput with value = v.Z }
value = v
}

let pivotInput = {
value = 0.0
min = -10000000.0
max = 10000000.0
step = 0.001
format = "{0:0.000}"
}

let initPivot (v : V3d) = {
x = { pivotInput with value = v.X }
y = { pivotInput with value = v.Y }
z = { pivotInput with value = v.Z }
value = v
}

let transformations = {
version = Transformations.current
useTranslationArrows = false
Expand All @@ -602,7 +618,7 @@ module Init =
yaw = Transformations.Initial.yaw
pitch = Transformations.Initial.pitch
roll = Transformations.Initial.roll
pivot = initTranslation (V3d.OOO)
pivot = initPivot (V3d.OOO)
oldPivot = V3d.OOO
showPivot = false
pivotChanged = false
Expand Down
6 changes: 5 additions & 1 deletion src/PRo3D.Core/Surface.fs
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,11 @@ module SurfaceIntersection =
match observedSystem surf.guid, observerSystem with
| Some observed, Some observer -> Some observed, Some observer
| _ -> None, None

//let sgSurf = activeSgSurfaces |> List.tryFind(fun sg -> sg.surface = surf.guid)
//let gBB =
// match sgSurf with
// | Some sg -> sg.globalBB.Center
// | None -> V3d.Zero
let fullTrafo = TransformationApp.fullTrafo' surf.transformation refSys observedSystem observerSystem //SurfaceTransformations.fullTrafo' surf refSys
//get bbs that are hit
let hitBoxes =
Expand Down
5 changes: 3 additions & 2 deletions src/PRo3D.Core/Surface/SurfaceApp.fs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ module SurfaceUtils =

/// creates a surface from opc folder path
let mk (stype:SurfaceType) (preferredLoader : MeshLoaderType) (maxTriangleSize : float) path =

let transform = Init.transformations
let names = Files.getOPCNames path
{
version = Surface.current
Expand Down Expand Up @@ -88,7 +88,8 @@ module SurfaceUtils =

colorCorrection = Init.initColorCorrection
homePosition = None
transformation = Init.transformations

transformation = transform //{transform with pivot = V3d.Zero}
opcxPath = None
radiometry = Init.initRadiometry

Expand Down
10 changes: 6 additions & 4 deletions src/PRo3D.Core/TransformationApp.fs
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ module TransformationApp =


let fullTrafo
//(bbCenter : V3d)
(transform : AdaptiveTransformations)
(refsys : AdaptiveReferenceSystem)
(observedSystem : aval<Option<SpiceReferenceSystem>>)
Expand All @@ -191,14 +192,15 @@ module TransformationApp =
// getNorthAndUpFromPivot transf refSys
// else
// north, up, north.Cross(up)

let newTrafo = calcFullTrafo translation yaw pitch roll (if usePivot then pivot else V3d.Zero) refSys observedSystem observerSystem scale mode
// (if (pivot = V3d.Zero) then bbCenter else pivot )
let newTrafo = calcFullTrafo translation yaw pitch roll (if usePivot then pivot else V3d.Zero) refSys observedSystem observerSystem scale mode //
return newTrafo
}


let fullTrafo'
(transform : Transformations)
//(bbCenter : V3d)
(refsys : ReferenceSystem)
(observedSystem : Option<SpiceReferenceSystem>)
(observerSystem : Option<ObserverSystem>) =
Expand All @@ -208,7 +210,7 @@ module TransformationApp =
// getNorthAndUpFromPivot transform refsys
// else
// refsys.northO, refsys.up.value, refsys.northO.Cross(refsys.up.value)

//let pivot = (if (transform.pivot.value = V3d.Zero) then bbCenter else transform.pivot.value )
calcFullTrafo
transform.translation.value
transform.yaw.value
Expand Down Expand Up @@ -291,7 +293,7 @@ module TransformationApp =
let p' = Vector3d.update model.pivot p
//let m' = updateTransformationForNewPivot model
//{ m' with pivot = p'; oldPivot = p'.value; trafoChanged = false}
let fulTrafo : Trafo3d = fullTrafo' model refSys None None
//let fulTrafo : Trafo3d = fullTrafo' model refSys None None
{ model with pivot = p'; oldPivot = p'.value; trafoChanged = false}
else model
| SetPickedPivotPoint p -> // world space.......
Expand Down
19 changes: 19 additions & 0 deletions src/PRo3D.Core/Traverse-Model.fs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ type TraversePropertiesAction =
| ToggleShowDots
| SetTraverseName of string
| SetSolTextsize of Numeric.Action
| SetLineWidth of Numeric.Action
| SetTraverseColor of ColorPicker.Action

type TraverseAction =
Expand All @@ -41,6 +42,13 @@ module InitTraverseParams =
step = 0.001
format = "{0:0.000}" }

let tLineW (w : float) =
{ value = w
min = 0.001
max = 10.0
step = 0.001
format = "{0:0.000}" }


type Sol =
{ version: int
Expand Down Expand Up @@ -137,6 +145,7 @@ type Traverse =
showLines: bool
showText: bool
tTextSize: NumericInput
tLineWidth: NumericInput
showDots: bool
isVisibleT: bool
color: ColorInput }
Expand Down Expand Up @@ -174,6 +183,7 @@ module Traverse =
showLines = true
showText = false
tTextSize = InitTraverseParams.tText
tLineWidth = InitTraverseParams.tLineW 1.5
showDots = false
isVisibleT = true
color = { c = C4b.White }
Expand All @@ -198,6 +208,7 @@ module Traverse =
showLines = showLines
showText = showText
tTextSize = InitTraverseParams.tText
tLineWidth = InitTraverseParams.tLineW 1.5
showDots = showDots
isVisibleT = true
color = { c = C4b.White } }
Expand All @@ -211,10 +222,16 @@ module Traverse =
let! showLines = Json.read "showLines"
let! showText = Json.read "showText"
let! tTextSize = Json.readWith Ext.fromJson<NumericInput, Ext> "tTextSize"
let! tLWidth = Json.tryRead "tLineWidth"
let! showDots = Json.read "showDots"
let! isVisibleT = Json.read "isVisibleT"
let! color = Json.readWith Ext.fromJson<ColorInput, Ext> "color"

let tLineWidth =
match tLWidth with
| Some w -> InitTraverseParams.tLineW w
| None -> InitTraverseParams.tLineW 1.5

return
{ version = current
guid = guid |> Guid
Expand All @@ -224,6 +241,7 @@ module Traverse =
showLines = showLines
showText = showText
tTextSize = tTextSize
tLineWidth = tLineWidth
showDots = showDots
isVisibleT = isVisibleT
color = color }
Expand Down Expand Up @@ -253,6 +271,7 @@ type Traverse with
do! Json.write "showDots" x.showDots
do! Json.write "isVisibleT" x.isVisibleT
do! Json.writeWith (Ext.toJson<ColorInput, Ext>) "color" x.color
do! Json.write "tLineWidth" x.tLineWidth.value
}

[<ModelType>]
Expand Down
2 changes: 1 addition & 1 deletion src/PRo3D.Viewer/Scene.fs
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ module SceneLoader =
|> Sg.createSgSurfaces runtime signature
|> HashMap.union m.scene.surfacesModel.sgSurfaces
|> Files.expandLazyKdTreePaths m.scene.scenePath surfaceMap
|> (flip <| Optic.set (_surfaceModelLens >-> SurfaceModel.sgSurfaces_)) m
|> (flip <| Optic.set (_surfaceModelLens >-> SurfaceModel.sgSurfaces_)) m

m.scene.surfacesModel
|> SurfaceModel.triggerSgGrouping
Expand Down
6 changes: 5 additions & 1 deletion src/PRo3D.Viewer/TraverseApp.fs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ module TraversePropertiesApp =
{ model with tTextSize = Numeric.update model.tTextSize s}
| SetTraverseColor tc ->
{ model with color = ColorPicker.update model.color tc }
| SetLineWidth w ->
{ model with tLineWidth = Numeric.update model.tLineWidth w}


let computeSolRotation (sol : Sol) (referenceSystem : ReferenceSystem) : Trafo3d =
Expand Down Expand Up @@ -112,6 +114,7 @@ module TraversePropertiesApp =
Html.row "Show Lines:" [GuiEx.iconCheckBox m.showLines ToggleShowLines]
Html.row "Show Dots:" [GuiEx.iconCheckBox m.showDots ToggleShowDots]
Html.row "Color:" [ColorPicker.view m.color |> UI.map SetTraverseColor ]
Html.row "Linewidth:" [Numeric.view' [NumericInputType.InputBox] m.tLineWidth |> UI.map SetLineWidth ]
]
)

Expand Down Expand Up @@ -580,11 +583,12 @@ module TraverseApp =
adaptive {
let! sols = model.sols
let! c = model.color.c
let! w = model.tLineWidth.value
let lines =
sols
|> List.map(fun x -> x.location)
|> List.toArray
|> PRo3D.Core.Drawing.Sg.lines c 2.0
|> PRo3D.Core.Drawing.Sg.lines c w

return lines
}
Expand Down
8 changes: 6 additions & 2 deletions src/PRo3D.Viewer/Viewer/Viewer-Utils.fs
Original file line number Diff line number Diff line change
Expand Up @@ -197,12 +197,14 @@ module ViewerUtils =

let getLodParameters
(surf:aval<AdaptiveSurface>)
(globalBB : aval<Box3d>)
(refsys:AdaptiveReferenceSystem)
(observedSystem : aval<Option<SpiceReferenceSystem>>)
(observerSystem : aval<Option<ObserverSystem>>)
(frustum : aval<Frustum>) =
adaptive {
let! s = surf
let! gBB = globalBB
let! frustum = frustum
let sizes = V2i(1024,768)
let! quality = s.quality.value
Expand Down Expand Up @@ -308,6 +310,7 @@ module ViewerUtils =

let trafo =
adaptive {
let! gBB = globalBB
let! fullTrafo = TransformationApp.fullTrafo surf.transformation refsys observedSystem observerSystem
let! preTransform = surf.preTransform
let! flipZ = surf.transformation.flipZ
Expand Down Expand Up @@ -436,7 +439,7 @@ module ViewerUtils =
|> Sg.noEvents
|> Sg.texture (Sym.ofString "ColorMapTexture") (AVal.constant colormap)
|> Sg.texture (Sym.ofString "FootPrintTexture") fp.projTex
|> Sg.LodParameters ( getLodParameters (AVal.constant surf) refsys observedSystem observerSystem frustum )
|> Sg.LodParameters ( getLodParameters (AVal.constant surf) globalBB refsys observedSystem observerSystem frustum )
|> Sg.AttributeParameters( attributeParameters (AVal.constant surf) )

|> SecondaryTexture.Sg.applySecondaryTextureId (
Expand Down Expand Up @@ -545,6 +548,7 @@ module ViewerUtils =

let trafo =
adaptive {
let! gBB = surface.globalBB
let! fullTrafo = TransformationApp.fullTrafo surf.transformation refsys observedSystem observerSystem
let! preTransform = surf.preTransform
let! flipZ = surf.transformation.flipZ
Expand Down Expand Up @@ -593,7 +597,7 @@ module ViewerUtils =
|> Sg.trafo trafo
|> Sg.uniform "TriangleSize" triangleFilter
|> Sg.onOff (surf.isVisible)
|> Sg.LodParameters( getLodParameters (AVal.constant surf) refsys observedSystem observerSystem frustum )
|> Sg.LodParameters( getLodParameters (AVal.constant surf) surface.globalBB refsys observedSystem observerSystem frustum )
|> Sg.noEvents
|> Sg.effect [
triangleFilterX |> toEffect
Expand Down
Loading

0 comments on commit c7a3741

Please sign in to comment.