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

Updates for GeometryBasics refactor #4319

Merged
merged 58 commits into from
Oct 16, 2024
Merged

Conversation

ffreyer
Copy link
Collaborator

@ffreyer ffreyer commented Sep 4, 2024

Description

Requires:

Version bumps:

This is still in prototyping stage as I'm looking what things GeometryBasics is missing/should do.

TODO:

  • Makie
    • compiles
    • tests
  • get GLMakie working
  • WGLMakie
    • compiles
    • tests pass
  • CairoMakie
    • compiles
    • tests pass
  • RPRMakie
    • compiles
    • tests pass

All RPRMakie examples run with JuliaGraphics/RadeonProRender.jl#22 except for:

  • datashader-rpr (the code is broken regardless of this pr)
  • material_x.jl (crashes julia)
  • sea_cables.jl (fails to download resources)

I'm not familiar enough with RPRMakie to say they look correct with confidence, but most look good to me. I'm not sure what to make of eat_topographie_sphere.jl (that's not a sphere?) and "volume.jl", they might be wrong.

Test failures:

  • FigureSpec step 5: This pr somehow generates a more transparent marker than the refimg, which is barely transparent. The code uses (:red, 0.5), so this seems more correct to me here. I'm just confused why it's different here at all
  • Scatter with FastPixel: red outline color looks more intense in 3D (maybe color change, maybe thickness change, maybe both
  • Triplot of a constained...: a line shifted from one diagonal to the other
  • shading of catmesh changed, seams visible fixed
  • CairoMakie Merged color Mesh change but that's expected due to updates to vertex order
  • CairoMakie voxel clipping looks more odd because triangle faces have shifted orientation fixed via Cleanup voxel clipping #4397
  • CairoMakie voxels have a small shift in face intersections
  • GLMakie heatmap cells shifted a little
  • "FEM mesh 3D" is expected to fail due to vertex index merging not running on load anymore (i.e. the example no longer duplicates vertices unnecessarily and thus the color mapping changed)

Issues:

Type of change

  • Breaking change

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
Copy link
Collaborator Author

ffreyer commented Sep 14, 2024

The refactor now makes it easier to work with per-face attributes, so I added an example to the mesh docs:

using GeometryBasics

# Reduce quality of sphere
s = Tesselation(Sphere(Point3f(0), 1f0), 12)
ps = coordinates(s)
fs = faces(s)

# Use a FaceView to with a new set of faces which refer to one color per face.
# Each face must have the same length as the respective face in fs.
# (Using the same face type guarantees this)
FT = eltype(fs); N = length(fs)
cs = FaceView(rand(RGBf, N), [FT(i) for i in 1:N])

# generate normals per face (this creates a FaceView as well)
ns = face_normals(ps, fs)

# Create mesh
m = GeometryBasics.mesh(ps, fs, normal = ns, color = cs)

mesh(m)

image

(This still requires vertex duplication, it just happens automatically now.)

Related Issues: #1369, #3624, maybe #742

@ffreyer ffreyer mentioned this pull request Oct 14, 2024
9 tasks
@ffreyer ffreyer changed the base branch from master to breaking-0.22 October 14, 2024 14:21
@ffreyer ffreyer closed this Oct 14, 2024
@ffreyer ffreyer reopened this Oct 14, 2024
@ffreyer ffreyer marked this pull request as ready for review October 15, 2024 22:53
@ffreyer ffreyer merged commit d6f9fdb into breaking-0.22 Oct 16, 2024
19 checks passed
@ffreyer ffreyer deleted the ff/GeometryBasics_refactor branch October 16, 2024 11:36
@SimonDanisch SimonDanisch restored the ff/GeometryBasics_refactor branch October 17, 2024 10:20
@EdsterG EdsterG mentioned this pull request Oct 24, 2024
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]>
@ffreyer ffreyer deleted the ff/GeometryBasics_refactor branch January 18, 2025 16:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking a PR with breaking changes
Projects
Status: Merged
Development

Successfully merging this pull request may close these issues.

Some triangles are not rendered Order of decomposes coordinates is not counter/clockwise
4 participants