Open daanhb opened 4 months ago
What's more: as soon as one package somewhere has the ability to plot a domain, we can borrow that functionality!
Proof of concept:
using DomainSets, DomainSetsExtensions, StaticArrays
using Meshes, CairoMakie
viz( 2 .* UnitCube() .+ SA[1.0,2.0,3.0])
On my setup in a notebook, this uses the plotting functionality of Meshes to show a cube defined in DomainSets.
At the start of DomainSets we identified a host of packages that did similar work (#14). There is an uncountable number of Julia packages defining a Point type!
The combination of package extensions with the improvements in DomainSets v0.7 towards domains-as-an-interface makes a lot more things possible. I'm experimenting with that in DomainSetsExtensions.jl. The mechanism of associating domains with "canonical domains" is essential here. It allows for automatic translation of types across packages.
Here is an example (works with master):
The code allows to combine domains of different types and different packages. It also automatically deduces that the cartesian product of an interval from Intervals.jl with an interval from IntervalSets.jl is equal to a Box as defined in Meshes.jl.