Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add transform_marker attribute to meshscatter #4606

Merged
merged 27 commits into from
Nov 28, 2024

Conversation

ffreyer
Copy link
Collaborator

@ffreyer ffreyer commented Nov 20, 2024

Description

Fixes #3323 (with changed default)

This pr adds the transform_marker attribute to meshscatter, which controls whether model applies to the scattered mesh or not. I.e. with transform_marker = false the marker used with meshscatter does not get affected by model, only the given positions do.

Example:

f = Figure(size = (300, 500))
a1,p1 = meshscatter(f[1, 1], Rect3f(Point3f(0), Vec3f(0.3)), transform_marker = true)
a2,p2 = meshscatter(f[2, 1], Rect3f(Point3f(0), Vec3f(0.3)), transform_marker = false)
scale!.((p1, p2), 5,5,5)
f

Screenshot 2024-11-20 161100

The current master behavior is transform_marker = true. I changed this to false to fix #3323. I also think it generally makes more sense, because markersize, rotation and the position argument of meshscatter already do what model does, on a per marker basis.

Example from Issue (only changed color):
Screenshot 2024-11-20 161353

Other changes

This pr now also includes some fixes to the meshscatter transformation/projection pipeline:

  • fixes order of float32convert and model in CairoMakie projection functions. This should be float32convert * model * transform_func(positions) (this also affects other primitives)
  • CairoMakie's draw_mesh3D was always applying transform_func to vertices, which does not match the GLMakie behavior for voxels and meshscatter
  • CairoMakie's draw_mesh3D did not work without normals
  • In GLMakie and WGLMakie the mesh from meshscatter did not consider float32converts at all. That meant that the mesh will be incorrectly scaled if f32c includes scaling.

TODO:

  • test transformation pipeline for meshscatter more thoroughly (model x transform_marker x transform func x float32convert)

Type of change

  • Breaking change (changes default behavior of meshscatter)

Checklist

  • Added an entry in CHANGELOG.md (for new features and breaking changes)
  • Added or changed relevant sections in the documentation
  • Added unit tests for new algorithms, conversion methods, etc.
  • Added reference image tests for new plotting functions, recipes, visual options, etc.

@ffreyer ffreyer changed the title Add transform_marker attribut eto meshscatter Add transform_marker attribute to meshscatter Nov 20, 2024
@MakieBot
Copy link
Collaborator

MakieBot commented Nov 20, 2024

Benchmark Results

SHA: 00af282008ee877613bb67a1a622ff6b570010b2

Warning

These results are subject to substantial noise because GitHub's CI runs on shared machines that are not ideally suited for benchmarking.

GLMakie
CairoMakie
WGLMakie

@ffreyer ffreyer marked this pull request as ready for review November 23, 2024 00:18
@ffreyer ffreyer mentioned this pull request Nov 23, 2024
9 tasks
@ffreyer ffreyer changed the base branch from master to breaking-0.22 November 25, 2024 14:21
@ffreyer ffreyer closed this Nov 28, 2024
@ffreyer ffreyer reopened this Nov 28, 2024
@ffreyer ffreyer merged commit a0d3ecd into breaking-0.22 Nov 28, 2024
21 of 22 checks passed
@ffreyer ffreyer deleted the ff/meshscatter-transform-marker branch November 28, 2024 20:48
SimonDanisch added a commit that referenced this pull request Dec 13, 2024
* update CI

* update versions

* dont test on branch push (already runs for prs against master)

* fix versions

* Updates for GeometryBasics refactor (#4319)

* get Makie to compile

* get GLMakie to compile

* fix  nromal rename, meshscatter

* fix pointtype in mesh conversion

* avoid matrix in vector rotation

* fix more tests

* update GeometryBasics functions/interface

* fix voronoiplot clipping

* update CairoMakie

* update RPRMakie

* prepare WGLMakie

* Update CI to use the GeometryBasics refactor branch (#4326)

* Update ci.yml

* Update Docs.yml

* Update reference_tests.yml

* add MeshIO branch

---------

Co-authored-by: ffreyer <[email protected]>

* update _faces

* normals -> normal

* add ShaderAbstractions to ci

* update docs, normals deprecation

* fix branch names

* fix catmesh getting normals regenerated

* update for ShaderAbstractions

* handle voxel clipping in CairoMakie like in GLMakie

* fix another two "normals"

* add dev branches for RPRMakie CI

* fix missing kwarg name in conversion

* update for FaceViews

* add example for per-face colors and normals

* improve typing

* fix Sampler, allow mipmap via Sampler

* try to fix benchmarks

* add to correct env

* remove from master project

* fix docs

* fix Rect decomposition

* fix poly converts

* fix typo

* improve precompilation by avoiding constprop and more direct icon loading via PNGFiles

* fix CairoMakie precompile

* fix old syntax

* fix ambient light

* add temp dependencies to relocatbility test

* bump RPR to required version

* update changelog

* fix test

* fix other branch in ray cast test

* fix relocatability ci

* fix rpr and relocatability

---------

Co-authored-by: Anshul Singhvi <[email protected]>
Co-authored-by: SimonDanisch <[email protected]>

* rename clear_faceviews

* update GeometryBasics dev branch

* update CI

* more CI bumps

* fix relocatibility CI

* fix 2x2 surface

* fix CairoMakie

* fix WGLMakie 2x2 surface

* fix picking tests

* remove reliance on Rect mesh generation

* Metamesh and multi mesh loading (#4496)

* prototype `mesh(::MetaMesh)`

* tweak default color handling

* add refimg test

* add docs

* add fallback for MetaMesh

* update CI dependencies

* try matching file without capitalization

* fix CairoMakie, WGLMakie test errors

* exclude from CairoMakie

---------

Co-authored-by: ffreyer <[email protected]>

* rename Tesselation -> Tessellation (#4564)

* try fix benchmark

* regenerate bundled

* update Changelog [skip CI]

* allow GeometryBasics 0.5 [skip ci]

* Change automatic color generation for Voronoiplot (#4357)

* Chane color generation

* Changelog

---------

Co-authored-by: Simon <[email protected]>
Co-authored-by: Frederic Freyer <[email protected]>

* add precompile for refreshcallback

* try gc() between compile timings

* update GeometryBasics, MeshIO versions

* update ShaderAbstractions & CI

* remove branches from relocatability

* remove dev branches from docs

* Split marker_offset from quad_offset (#4594)

* split marker_offset from quad_offset

* add test

* fix typo

* add 3D tests

* fix FastPixel scaling with marker_offset in data space

* improve test, remove old

* fix CairoMakie image scatter offset

* tweak test some more

* test marker_offset with 2D and 3D rotations

* fix 2D rotation + marker_offset + Rect in CairoMakie

* exclude 3D test in CairoMakie

* fix test error

* 1.6 compat

* update changelog

* add attribute example

* remove TODO

* Add `transform_marker` attribute to meshscatter (#4606)

* add transform_marker attribute

* add refimg test

* update changelog

* allow mesh with no normals in mesh3d path

* cleanup mesh3d transformation pipeline

* add test

* apply f32c.scale to meshscatter vertices in GLMakie, WGLMakie

* fix WGLMakie

* tweak test to include significant float32convert scaling

* fix voxels

* remove f32c + transform func tests

(doesn't check what its supposed to)

* fix wrong order for f32convert and model

* fix double translation with transform_marker = true

* fix unwanted model application with transform_marker = false

* make limits static in test

* test model + transform_marker with f32c and transform func

* update and test boundingbox with transform_marker

* Makie.rotate!

* remove initial refimg test

* update changelog

* fix missing newline

* fix deprecated normals

* Add zooming & translation controls to Axis3 (#4131)

* zoom prototype

* add zooming as an Interaction

* add limit reset

* add translation

* make translation more accurate

* add docstrings

* fix x/y/z reversed

* update changelog [skip ci]

* move code to the right places

* fix corrupted gl state

* fix CairoMakie text - clip planes interaction

* remove comment

* reuse and conform to existing infrastructure

* add docs for Axis3 interactions

* add unit tests & fix zoom coordinate system

* do plot picking ray cast as part of :cursor zoom

* remove old code

* match zoom direction with Axis, LScene

* update tests

* add viewmode = :free

* tweak refimg to include perspectiveness and be less wide

* fix some test failures

* revert change to decorations

* fix backend dependency of new refimg

* fix var name in new test

* avoid rendering issues from too small near

* skip irrelevant code for viewmode = :free

* fix aspect problems with translations

* cleanup some stuff

* reuse in-axis translations for viewmode = :free

* add center-on-cursor interaction

* fix limit reset not resetting targetlimits

* fix position_on_plot error for 2D meshes

* move framelines to 3D scene to avoid line inversion issue

Which comes from just doing xyz/w in inversions. This is not valid if w <= 0, at least with perspective projection

* use Float64

* bandaid fix for render order

* Change LimitReset to more closely match Axis

* update docs

* fix offset between ticks and grid/frame

* fix test error

* add test for project(scene, point)

* add option to clip decorations (default on)

* use viewport for clipping

* don't clip decorations by default because it clips titles and too much of labels/tick labels

* make test more robust

---------

Co-authored-by: Simon <[email protected]>

* Fix Float32 constraints in poly pipeline (#4615)

* Fix Float32 constraints in poly pipeline

Also fix dimensionality constraints

* changelog

* Update poly.jl

* Update poly.jl

---------

Co-authored-by: Simon <[email protected]>

* try fixing memory leak

* aggressively clean up objects

* check screen outside animationframe + upload electron logs in CI

* Clean up CI + CHangelog

* Update CHANGELOG.md

---------

Co-authored-by: Anshul Singhvi <[email protected]>
Co-authored-by: SimonDanisch <[email protected]>
Co-authored-by: Daniel VandenHeuvel <[email protected]>
ffreyer added a commit that referenced this pull request Dec 16, 2024
* Added field fullbox to controll if the full box of
Framelines is drawn.
Added fields xspinecolor_4, yspinecolor_4 and
zspinecolor_4 to control the color of the 4th line
when the fullbox is drawn.

* Renamed function   to_topscene_z_2d into
to_topscene_small_z_2d.
Createted function  to_topscene_big_z_2d to
project points into parent space with a big z value

* Renamed varaiable framepoints to framepoints_main.
Added variable fraimpoints_fullbox replicating
the functionality of assining to framepoints_main
using p7 and p8 and the function to_topscene_big_z_2d.
Added an if statement to add the front lines of the fullbox
if the field fullbox od Axis3 is true.

* Correctet/removed coments

* Added spinecolor_4 to theme_black.

* Create the fullbox lines anyway, just controll
visibility by ax.fullbox && attr(:spinesvisible).

* Changed the name "fullbox" into "front_spines"

* spine_color

* Update CHANGELOG.md

* update CI

* update versions

* dont test on branch push (already runs for prs against master)

* fix versions

* Updates for GeometryBasics refactor (#4319)

* get Makie to compile

* get GLMakie to compile

* fix  nromal rename, meshscatter

* fix pointtype in mesh conversion

* avoid matrix in vector rotation

* fix more tests

* update GeometryBasics functions/interface

* fix voronoiplot clipping

* update CairoMakie

* update RPRMakie

* prepare WGLMakie

* Update CI to use the GeometryBasics refactor branch (#4326)

* Update ci.yml

* Update Docs.yml

* Update reference_tests.yml

* add MeshIO branch

---------

Co-authored-by: ffreyer <[email protected]>

* update _faces

* normals -> normal

* add ShaderAbstractions to ci

* update docs, normals deprecation

* fix branch names

* fix catmesh getting normals regenerated

* update for ShaderAbstractions

* handle voxel clipping in CairoMakie like in GLMakie

* fix another two "normals"

* add dev branches for RPRMakie CI

* fix missing kwarg name in conversion

* update for FaceViews

* add example for per-face colors and normals

* improve typing

* fix Sampler, allow mipmap via Sampler

* try to fix benchmarks

* add to correct env

* remove from master project

* fix docs

* fix Rect decomposition

* fix poly converts

* fix typo

* improve precompilation by avoiding constprop and more direct icon loading via PNGFiles

* fix CairoMakie precompile

* fix old syntax

* fix ambient light

* add temp dependencies to relocatbility test

* bump RPR to required version

* update changelog

* fix test

* fix other branch in ray cast test

* fix relocatability ci

* fix rpr and relocatability

---------

Co-authored-by: Anshul Singhvi <[email protected]>
Co-authored-by: SimonDanisch <[email protected]>

* rename clear_faceviews

* update GeometryBasics dev branch

* update CI

* more CI bumps

* fix relocatibility CI

* fix 2x2 surface

* fix CairoMakie

* fix WGLMakie 2x2 surface

* fix picking tests

* remove reliance on Rect mesh generation

* Metamesh and multi mesh loading (#4496)

* prototype `mesh(::MetaMesh)`

* tweak default color handling

* add refimg test

* add docs

* add fallback for MetaMesh

* update CI dependencies

* try matching file without capitalization

* fix CairoMakie, WGLMakie test errors

* exclude from CairoMakie

---------

Co-authored-by: ffreyer <[email protected]>

* rename Tesselation -> Tessellation (#4564)

* try fix benchmark

* regenerate bundled

* update Changelog [skip CI]

* allow GeometryBasics 0.5 [skip ci]

* Change automatic color generation for Voronoiplot (#4357)

* Chane color generation

* Changelog

---------

Co-authored-by: Simon <[email protected]>
Co-authored-by: Frederic Freyer <[email protected]>

* add precompile for refreshcallback

* try gc() between compile timings

* update GeometryBasics, MeshIO versions

* update ShaderAbstractions & CI

* remove branches from relocatability

* remove dev branches from docs

* Split marker_offset from quad_offset (#4594)

* split marker_offset from quad_offset

* add test

* fix typo

* add 3D tests

* fix FastPixel scaling with marker_offset in data space

* improve test, remove old

* fix CairoMakie image scatter offset

* tweak test some more

* test marker_offset with 2D and 3D rotations

* fix 2D rotation + marker_offset + Rect in CairoMakie

* exclude 3D test in CairoMakie

* fix test error

* 1.6 compat

* update changelog

* add attribute example

* remove TODO

* Add `transform_marker` attribute to meshscatter (#4606)

* add transform_marker attribute

* add refimg test

* update changelog

* allow mesh with no normals in mesh3d path

* cleanup mesh3d transformation pipeline

* add test

* apply f32c.scale to meshscatter vertices in GLMakie, WGLMakie

* fix WGLMakie

* tweak test to include significant float32convert scaling

* fix voxels

* remove f32c + transform func tests

(doesn't check what its supposed to)

* fix wrong order for f32convert and model

* fix double translation with transform_marker = true

* fix unwanted model application with transform_marker = false

* make limits static in test

* test model + transform_marker with f32c and transform func

* update and test boundingbox with transform_marker

* Makie.rotate!

* remove initial refimg test

* update changelog

* fix missing newline

* fix deprecated normals

* Add zooming & translation controls to Axis3 (#4131)

* zoom prototype

* add zooming as an Interaction

* add limit reset

* add translation

* make translation more accurate

* add docstrings

* fix x/y/z reversed

* update changelog [skip ci]

* move code to the right places

* fix corrupted gl state

* fix CairoMakie text - clip planes interaction

* remove comment

* reuse and conform to existing infrastructure

* add docs for Axis3 interactions

* add unit tests & fix zoom coordinate system

* do plot picking ray cast as part of :cursor zoom

* remove old code

* match zoom direction with Axis, LScene

* update tests

* add viewmode = :free

* tweak refimg to include perspectiveness and be less wide

* fix some test failures

* revert change to decorations

* fix backend dependency of new refimg

* fix var name in new test

* avoid rendering issues from too small near

* skip irrelevant code for viewmode = :free

* fix aspect problems with translations

* cleanup some stuff

* reuse in-axis translations for viewmode = :free

* add center-on-cursor interaction

* fix limit reset not resetting targetlimits

* fix position_on_plot error for 2D meshes

* move framelines to 3D scene to avoid line inversion issue

Which comes from just doing xyz/w in inversions. This is not valid if w <= 0, at least with perspective projection

* use Float64

* bandaid fix for render order

* Change LimitReset to more closely match Axis

* update docs

* fix offset between ticks and grid/frame

* fix test error

* add test for project(scene, point)

* add option to clip decorations (default on)

* use viewport for clipping

* don't clip decorations by default because it clips titles and too much of labels/tick labels

* make test more robust

---------

Co-authored-by: Simon <[email protected]>

* Fix Float32 constraints in poly pipeline (#4615)

* Fix Float32 constraints in poly pipeline

Also fix dimensionality constraints

* changelog

* Update poly.jl

* Update poly.jl

---------

Co-authored-by: Simon <[email protected]>

* try fixing memory leak

* aggressively clean up objects

* check screen outside animationframe + upload electron logs in CI

* Clean up CI + CHangelog

* Update CHANGELOG.md

* fix merge, cleanup

* add refimg test

* add Sphere to verify z-order and check for artifacts

* fiddle with rendering so that WGLMakie, CairoMakie order frame lines correctly without GLMakie, WGLMakie artifacting + tweak test

---------

Co-authored-by: ffreyer <[email protected]>
Co-authored-by: Simon <[email protected]>
Co-authored-by: Anshul Singhvi <[email protected]>
Co-authored-by: Daniel VandenHeuvel <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Merged
Development

Successfully merging this pull request may close these issues.

Axis3 causes markers of a meshscatter to be transformed
3 participants