Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • pyddg pyddg
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 190
    • Issues 190
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 11
    • Merge requests 11
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Metrics
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • pyddg
  • pyddgpyddg
  • Merge requests
  • !474

Draft: Blender conversion and vectorisation

  • Review changes

  • Download
  • Patches
  • Plain diff
Closed Le Nam Do requested to merge new-blender-conversion-api into develop Nov 15, 2022
  • Overview 7
  • Commits 64
  • Pipelines 18
  • Changes 46

Draft. My experimental branch.

Blender conversion

Examples live in examples/vectorised. Run them with

blender --python examples/vectorised/new_blender_api.py

Interesting examples are

  • examples/vectorised/new_blender_api.py - for a prototype API
  • examples/vectorised/scatter.py - for tubes and spheres
  • examples/vectorised/scatter_bicolour.py - for bicolouring tubes and spheres, but scattering and displaying is decoupled
  • examples/vectorised/scatter_link_bicolour.py - for bicolouring tubes and spheres and scattering and displaying is coupled, just like in develop
  • examples/vectorised/discrete_curve.py, examples/vectorised/discrete_net.py, examples/vectorised/half_edge.py - for converting library objects

untitled untitled

This branch is also a testbed for decoupling visualisation from Blender. For example, first run

poetry install --sync --with dev --with docs --with tests --with coverage --with plot

Notice the --with plot. This installs plotly. Most examples can also be visualised in plotly

python3 examples/vectorised/sphere.py

newplot

Of course, everything is vectorised. Points are stored in columns rather than rows. Both have advantages and disadvantages, e.g.

  • with column-data, A @ points, where A is a matrix works as expected, row-data would require points @ A.T
  • with row-data, points + translation, where translation.shape == (3,) works as expected, but column-data requires points + translation.reshape((3, 1)) or similar
  • seems like scipy, scikit etc. usually store data in the rows, haven't checked thoroughly yet
Edited Nov 16, 2022 by Le Nam Do
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: new-blender-conversion-api