diff --git a/Project.toml b/Project.toml index ebe9d4f..3efc26d 100644 --- a/Project.toml +++ b/Project.toml @@ -5,6 +5,7 @@ version = "0.1.0" [deps] CoordinateTransformations = "150eb455-5306-5404-9cee-2592286d6298" +ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210" GeometryBasics = "5c1252a2-5f33-56bf-86c9-59e7332b4326" LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" Meshing = "e6723b4c-ebff-59f1-b4b7-d97aa5274f73" @@ -12,27 +13,33 @@ Rotations = "6038ab10-8711-5258-84ad-4b1120ba62dc" StaticArrays = "90137ffa-7385-5640-81b9-e52037218182" [compat] +Aqua = "0.8" CoordinateTransformations = "0.6" +Combinatorics = "1" +FileIO = "1" +ForwardDiff = "0.10" GeometryBasics = "0.4" +LinearAlgebra = "1" Meshing = "0.5" +MeshIO = "0.4" +Revise = "3" Rotations = "1" StaticArrays = "1" +Test = "1" +WGLMakie = "0.10" julia = "1.6" [extras] -BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf" +Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595" Combinatorics = "861a8166-3701-5b0c-9a16-15d98fcdc6aa" -Descartes = "ea4ead7c-22ac-5e77-afc5-cd927cdc0b20" FileIO = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549" ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210" GeometryBasics = "5c1252a2-5f33-56bf-86c9-59e7332b4326" -HCubature = "19dc6840-f33b-545b-b366-655c7e3ffd49" MeshIO = "7269a6da-0436-5bbc-96c2-40638cbb6118" Revise = "295af30f-e4ad-537b-8983-00126c2a3abe" -QuadGK = "1fd47b50-473d-5c70-9696-f719f8f3bcdc" StaticArrays = "90137ffa-7385-5640-81b9-e52037218182" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" WGLMakie = "276b4fcb-3e11-5398-bf8b-a0c2d153d008" [targets] -test = ["Test", "Revise", "Combinatorics", "StaticArrays", "MeshIO", "FileIO", "WGLMakie", "BenchmarkTools"] +test = ["Test", "Aqua", "Revise", "StaticArrays", "MeshIO", "FileIO", "WGLMakie", "Combinatorics"] diff --git a/examples/Manifest.toml b/examples/Manifest.toml index 87fbb4e..d8cb611 100644 --- a/examples/Manifest.toml +++ b/examples/Manifest.toml @@ -2,7 +2,20 @@ julia_version = "1.10.4" manifest_format = "2.0" -project_hash = "79f437763e6a1eb62c3106094973df8666180632" +project_hash = "45f0ef80ca12ef806f32247cd0d5651dd69dc4de" + +[[deps.ADTypes]] +git-tree-sha1 = "fa0822e5baee6e23081c2685ae27265dabee23d8" +uuid = "47edcb42-4c32-4615-8424-f2b9edc5f35b" +version = "1.4.0" + + [deps.ADTypes.extensions] + ADTypesChainRulesCoreExt = "ChainRulesCore" + ADTypesEnzymeCoreExt = "EnzymeCore" + + [deps.ADTypes.weakdeps] + ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" + EnzymeCore = "f151be2c-9106-41f4-ab19-57ee4f262869" [[deps.AbstractFFTs]] deps = ["LinearAlgebra"] @@ -20,6 +33,27 @@ git-tree-sha1 = "2d9c9a55f9c93e8887ad391fbae72f8ef55e1177" uuid = "1520ce14-60c1-5f80-bbc7-55ef81b5835c" version = "0.4.5" +[[deps.Accessors]] +deps = ["CompositionsBase", "ConstructionBase", "Dates", "InverseFunctions", "LinearAlgebra", "MacroTools", "Markdown", "Test"] +git-tree-sha1 = "c0d491ef0b135fd7d63cbc6404286bc633329425" +uuid = "7d9f7c33-5ae7-4f3b-8dc6-eff91059b697" +version = "0.1.36" + + [deps.Accessors.extensions] + AccessorsAxisKeysExt = "AxisKeys" + AccessorsIntervalSetsExt = "IntervalSets" + AccessorsStaticArraysExt = "StaticArrays" + AccessorsStructArraysExt = "StructArrays" + AccessorsUnitfulExt = "Unitful" + + [deps.Accessors.weakdeps] + AxisKeys = "94b1ba4f-4ee9-5380-92f1-94cde586c3c5" + IntervalSets = "8197267c-284f-5f27-9208-e0e47529a953" + Requires = "ae029012-a4dd-5104-9daa-d747884805df" + StaticArrays = "90137ffa-7385-5640-81b9-e52037218182" + StructArrays = "09ab397b-f2b6-538f-b94a-2f83cf4a842a" + Unitful = "1986cc42-f94f-5a68-af5c-568840ba703d" + [[deps.Adapt]] deps = ["LinearAlgebra", "Requires"] git-tree-sha1 = "6a55b747d1812e699320963ffde36f1ebdda4099" @@ -46,6 +80,34 @@ version = "0.4.1" uuid = "0dad84c5-d112-42e6-8d28-ef12dabb789f" version = "1.1.1" +[[deps.ArrayInterface]] +deps = ["Adapt", "LinearAlgebra", "SparseArrays", "SuiteSparse"] +git-tree-sha1 = "ed2ec3c9b483842ae59cd273834e5b46206d6dda" +uuid = "4fba245c-0d91-5ea0-9b3e-6abc04ee57a9" +version = "7.11.0" + + [deps.ArrayInterface.extensions] + ArrayInterfaceBandedMatricesExt = "BandedMatrices" + ArrayInterfaceBlockBandedMatricesExt = "BlockBandedMatrices" + ArrayInterfaceCUDAExt = "CUDA" + ArrayInterfaceCUDSSExt = "CUDSS" + ArrayInterfaceChainRulesExt = "ChainRules" + ArrayInterfaceGPUArraysCoreExt = "GPUArraysCore" + ArrayInterfaceReverseDiffExt = "ReverseDiff" + ArrayInterfaceStaticArraysCoreExt = "StaticArraysCore" + ArrayInterfaceTrackerExt = "Tracker" + + [deps.ArrayInterface.weakdeps] + BandedMatrices = "aae01518-5342-5314-be14-df237901396f" + BlockBandedMatrices = "ffab5731-97b5-5995-9138-79e8c1846df0" + CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba" + CUDSS = "45b445bb-4962-46a0-9369-b4df9d0f772e" + ChainRules = "082447d4-558c-5d27-93f4-14fc19e9eca2" + GPUArraysCore = "46192b85-c4d5-4398-a991-12ede77f4527" + ReverseDiff = "37e2e3b7-166d-5795-8a7a-e32c996b4267" + StaticArraysCore = "1e83bf80-4336-4d27-bf5d-d5a4f845583c" + Tracker = "9f7883ad-71c0-57eb-9f7f-b5c9e6d3789c" + [[deps.Artifacts]] uuid = "56f22d72-fd6d-98f1-02f0-08ddc0907c33" @@ -76,6 +138,11 @@ git-tree-sha1 = "f1dff6729bc61f4d49e140da1af55dcd1ac97b2f" uuid = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf" version = "1.5.0" +[[deps.Bijections]] +git-tree-sha1 = "c9b163bd832e023571e86d0b90d9de92a9879088" +uuid = "e2ed5e7c-b2de-5872-ae92-c73ca462fb04" +version = "0.1.6" + [[deps.BitFlags]] git-tree-sha1 = "2dc09997850d68179b69dafb58ae806167a32b1b" uuid = "d1d4a3ce-64b1-5f1a-9ba4-7e7e69966f35" @@ -121,9 +188,9 @@ version = "0.5.1" [[deps.ChainRulesCore]] deps = ["Compat", "LinearAlgebra"] -git-tree-sha1 = "575cd02e080939a33b6df6c5853d14924c08e35b" +git-tree-sha1 = "71acdbf594aab5bbb2cec89b208c41b4c411e49f" uuid = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" -version = "1.23.0" +version = "1.24.0" weakdeps = ["SparseArrays"] [deps.ChainRulesCore.extensions] @@ -180,6 +247,11 @@ git-tree-sha1 = "08c8b6831dc00bfea825826be0bc8336fc369860" uuid = "861a8166-3701-5b0c-9a16-15d98fcdc6aa" version = "1.0.2" +[[deps.CommonSolve]] +git-tree-sha1 = "0eee5eb66b1cf62cd6ad1b460238e60e4b09400c" +uuid = "38540f10-b2f7-11e9-35d8-d573e4eb0ff2" +version = "0.2.4" + [[deps.CommonSubexpressions]] deps = ["MacroTools", "Test"] git-tree-sha1 = "7b8a93dba8af7e3b42fecabf646260105ac373f7" @@ -201,6 +273,20 @@ deps = ["Artifacts", "Libdl"] uuid = "e66e0078-7015-5450-92f7-15fbd957f2ae" version = "1.1.1+0" +[[deps.CompositeTypes]] +git-tree-sha1 = "bce26c3dab336582805503bed209faab1c279768" +uuid = "b152e2b5-7a66-4b01-a709-34e65c35f657" +version = "0.1.4" + +[[deps.CompositionsBase]] +git-tree-sha1 = "802bb88cd69dfd1509f6670416bd4434015693ad" +uuid = "a33af91c-f02d-484b-be07-31d278c5ca2b" +version = "0.1.2" +weakdeps = ["InverseFunctions"] + + [deps.CompositionsBase.extensions] + CompositionsBaseInverseFunctionsExt = "InverseFunctions" + [[deps.ConcurrentUtilities]] deps = ["Serialization", "Sockets"] git-tree-sha1 = "6cbbd4d241d7e6579ab354737f4dd95ca43946e1" @@ -262,7 +348,7 @@ uuid = "04572ae6-984a-583e-9378-9577a1c2574d" version = "1.33.4+0" [[deps.Descartes]] -deps = ["CoordinateTransformations", "GeometryBasics", "LinearAlgebra", "Meshing", "Rotations", "StaticArrays"] +deps = ["CoordinateTransformations", "ForwardDiff", "GeometryBasics", "LinearAlgebra", "Meshing", "Rotations", "StaticArrays"] path = ".." uuid = "ea4ead7c-22ac-5e77-afc5-cd927cdc0b20" version = "0.1.0" @@ -285,9 +371,9 @@ uuid = "8ba89e20-285c-5b6f-9357-94700520ee1b" [[deps.Distributions]] deps = ["AliasTables", "FillArrays", "LinearAlgebra", "PDMats", "Printf", "QuadGK", "Random", "SpecialFunctions", "Statistics", "StatsAPI", "StatsBase", "StatsFuns"] -git-tree-sha1 = "22c595ca4146c07b16bcf9c8bea86f731f7109d2" +git-tree-sha1 = "9c405847cc7ecda2dc921ccf18b47ca150d7317e" uuid = "31c24e10-a181-5473-b8eb-7969acd0382f" -version = "0.25.108" +version = "0.25.109" [deps.Distributions.extensions] DistributionsChainRulesCoreExt = "ChainRulesCore" @@ -305,6 +391,16 @@ git-tree-sha1 = "2fb1e02f2b635d0845df5d7c167fec4dd739b00d" uuid = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae" version = "0.9.3" +[[deps.DomainSets]] +deps = ["CompositeTypes", "IntervalSets", "LinearAlgebra", "Random", "StaticArrays"] +git-tree-sha1 = "490392af2c7d63183bfa2c8aaa6ab981c5ba7561" +uuid = "5b8099bc-c8ec-5219-889f-1d9e522a28bf" +version = "0.7.14" +weakdeps = ["Makie"] + + [deps.DomainSets.extensions] + DomainSetsMakieExt = "Makie" + [[deps.Downloads]] deps = ["ArgTools", "FileWatching", "LibCURL", "NetworkOptions"] uuid = "f43a241f-c20a-4ad4-852c-f6b1247861c6" @@ -316,6 +412,12 @@ git-tree-sha1 = "5837a837389fccf076445fce071c8ddaea35a566" uuid = "fa6b7ba4-c1ee-5f82-b5fc-ecf0adba8f74" version = "0.6.8" +[[deps.DynamicPolynomials]] +deps = ["Future", "LinearAlgebra", "MultivariatePolynomials", "MutableArithmetics", "Pkg", "Reexport", "Test"] +git-tree-sha1 = "30a1848c4f4fc35d1d4bbbd125650f6a11b5bc6c" +uuid = "7c1d4256-1411-5781-91ec-d7bc3513ac07" +version = "0.5.7" + [[deps.EarCut_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] git-tree-sha1 = "e3290f2d49e661fbd94046d7e3726ffcb2d41053" @@ -345,10 +447,15 @@ git-tree-sha1 = "1c6317308b9dc757616f0b5cb379db10494443a7" uuid = "2e619515-83b5-522b-bb60-26c02a35a201" version = "2.6.2+0" +[[deps.ExprTools]] +git-tree-sha1 = "27415f162e6028e81c72b82ef756bf321213b6ec" +uuid = "e2ba6199-217a-4e67-a87a-7c52f15ade04" +version = "0.1.10" + [[deps.Extents]] -git-tree-sha1 = "2140cd04483da90b2da7f99b2add0750504fc39c" +git-tree-sha1 = "94997910aca72897524d2237c41eb852153b0f65" uuid = "411431e0-e8b7-467b-b5e0-f676ba4f2910" -version = "0.1.2" +version = "0.1.3" [[deps.FFMPEG_jll]] deps = ["Artifacts", "Bzip2_jll", "FreeType2_jll", "FriBidi_jll", "JLLWrappers", "LAME_jll", "Libdl", "Ogg_jll", "OpenSSL_jll", "Opus_jll", "PCRE2_jll", "Zlib_jll", "libaom_jll", "libass_jll", "libfdk_aac_jll", "libvorbis_jll", "x264_jll", "x265_jll"] @@ -436,9 +543,9 @@ version = "4.1.1" [[deps.FreeType2_jll]] deps = ["Artifacts", "Bzip2_jll", "JLLWrappers", "Libdl", "Zlib_jll"] -git-tree-sha1 = "d8db6a5a2fe1381c1ea4ef2cab7c69c2de7f9ea0" +git-tree-sha1 = "5c1d8ae0efc6c2e7b1fc502cbe25def8f661b7bc" uuid = "d7e528f0-a631-5988-bf34-fe36492bcfd7" -version = "2.13.1+0" +version = "2.13.2+0" [[deps.FreeTypeAbstraction]] deps = ["ColorVectorSpace", "Colors", "FreeType", "GeometryBasics"] @@ -452,6 +559,27 @@ git-tree-sha1 = "1ed150b39aebcc805c26b93a8d0122c940f64ce2" uuid = "559328eb-81f9-559d-9380-de523a88c83c" version = "1.0.14+0" +[[deps.FunctionWrappers]] +git-tree-sha1 = "d62485945ce5ae9c0c48f124a84998d755bae00e" +uuid = "069b7b12-0de2-55c6-9aab-29f3d0a68a2e" +version = "1.1.3" + +[[deps.FunctionWrappersWrappers]] +deps = ["FunctionWrappers"] +git-tree-sha1 = "b104d487b34566608f8b4e1c39fb0b10aa279ff8" +uuid = "77dc65aa-8811-40c2-897b-53d922fa7daf" +version = "0.1.3" + +[[deps.Future]] +deps = ["Random"] +uuid = "9fa8497b-333b-5362-9e8d-4d0656e87820" + +[[deps.GPUArraysCore]] +deps = ["Adapt"] +git-tree-sha1 = "ec632f177c0d990e64d955ccc1b8c04c485a0950" +uuid = "46192b85-c4d5-4398-a991-12ede77f4527" +version = "0.1.6" + [[deps.GeoInterface]] deps = ["Extents"] git-tree-sha1 = "801aef8228f7f04972e596b09d4dba481807c913" @@ -529,6 +657,11 @@ git-tree-sha1 = "179267cfa5e712760cd43dcae385d7ea90cc25a4" uuid = "47d2ed2b-36de-50cf-bf87-49c2cf4b8b91" version = "0.0.5" +[[deps.IfElse]] +git-tree-sha1 = "debdd00ffef04665ccbb3e150747a77560e8fad1" +uuid = "615f187c-cbe4-4ef1-ba3b-2fcf58d6d173" +version = "0.1.1" + [[deps.ImageAxes]] deps = ["AxisArrays", "ImageBase", "ImageCore", "Reexport", "SimpleTraits"] git-tree-sha1 = "2e4520d67b0cef90865b3ef727594d2a58e0e1f8" @@ -571,9 +704,9 @@ uuid = "9b13fd28-a010-5f03-acff-a1bbcff69959" version = "1.0.0" [[deps.Inflate]] -git-tree-sha1 = "ea8031dea4aff6bd41f1df8f2fdfb25b33626381" +git-tree-sha1 = "d1b1b796e47d94588b3757fe84fbf65a5ec4a80d" uuid = "d25df0c9-e2be-5dd7-82c8-3ad0b3e990b9" -version = "0.1.4" +version = "0.1.5" [[deps.IntelOpenMP_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl"] @@ -597,9 +730,9 @@ weakdeps = ["Unitful"] [[deps.IntervalArithmetic]] deps = ["CRlibm_jll", "MacroTools", "RoundingEmulator"] -git-tree-sha1 = "23ddd329f4a2a65c7a55b91553b60849bd038575" +git-tree-sha1 = "433b0bb201cd76cb087b017e49244f10394ebe9c" uuid = "d1acc4aa-44c8-5952-acd4-ba5d80a2a253" -version = "0.22.11" +version = "0.22.14" weakdeps = ["DiffRules", "ForwardDiff", "RecipesBase"] [deps.IntervalArithmetic.extensions] @@ -618,6 +751,16 @@ weakdeps = ["Random", "RecipesBase", "Statistics"] IntervalSetsRecipesBaseExt = "RecipesBase" IntervalSetsStatisticsExt = "Statistics" +[[deps.InverseFunctions]] +deps = ["Test"] +git-tree-sha1 = "e7cbed5032c4c397a6ac23d1493f3289e01231c4" +uuid = "3587e190-3f89-42d0-90ee-14403ec27112" +version = "0.1.14" +weakdeps = ["Dates"] + + [deps.InverseFunctions.extensions] + DatesExt = "Dates" + [[deps.IrrationalConstants]] git-tree-sha1 = "630b497eafcc20001bba38a4651b327dcfc491d2" uuid = "92d709cd-6900-40b7-9082-c6be49f344b6" @@ -665,9 +808,9 @@ version = "3.0.3+0" [[deps.JuliaInterpreter]] deps = ["CodeTracking", "InteractiveUtils", "Random", "UUIDs"] -git-tree-sha1 = "e9648d90370e2d0317f9518c9c6e0841db54a90b" +git-tree-sha1 = "a6adc2dcfe4187c40dc7c2c9d2128e326360e90a" uuid = "aa1ae85d-cabe-5617-a682-6adf51b2e16a" -version = "0.9.31" +version = "0.9.32" [[deps.KernelDensity]] deps = ["Distributions", "DocStringExtensions", "FFTW", "Interpolations", "StatsBase"] @@ -698,6 +841,31 @@ git-tree-sha1 = "50901ebc375ed41dbf8058da26f9de442febbbec" uuid = "b964fa9f-0449-5b57-a5c2-d3ea65f4040f" version = "1.3.1" +[[deps.LabelledArrays]] +deps = ["ArrayInterface", "ChainRulesCore", "ForwardDiff", "LinearAlgebra", "MacroTools", "PreallocationTools", "RecursiveArrayTools", "StaticArrays"] +git-tree-sha1 = "e459fda6b68ea8684b3fcd513d2fd1e5130c4402" +uuid = "2ee39098-c373-598a-b85f-a56591580800" +version = "1.16.0" + +[[deps.LambertW]] +git-tree-sha1 = "c5ffc834de5d61d00d2b0e18c96267cffc21f648" +uuid = "984bce1d-4616-540c-a9ee-88d1112d94c9" +version = "0.4.6" + +[[deps.Latexify]] +deps = ["Format", "InteractiveUtils", "LaTeXStrings", "MacroTools", "Markdown", "OrderedCollections", "Requires"] +git-tree-sha1 = "e0b5cd21dc1b44ec6e64f351976f961e6f31d6c4" +uuid = "23fbe1c1-3f47-55db-b15f-69d7ec21a316" +version = "0.16.3" + + [deps.Latexify.extensions] + DataFramesExt = "DataFrames" + SymEngineExt = "SymEngine" + + [deps.Latexify.weakdeps] + DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0" + SymEngine = "123dc426-2d89-5057-bbad-38513e3affd8" + [[deps.LazyArtifacts]] deps = ["Artifacts", "Pkg"] uuid = "4af54fe1-eca0-43a8-85a7-787d91b784e3" @@ -776,9 +944,9 @@ uuid = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" [[deps.LogExpFunctions]] deps = ["DocStringExtensions", "IrrationalConstants", "LinearAlgebra"] -git-tree-sha1 = "18144f3e9cbe9b15b070288eef858f71b291ce37" +git-tree-sha1 = "a2d09619db4e765091ee5c6ffe8872849de0feea" uuid = "2ab3a3ac-af41-5b50-aa03-7779005ae688" -version = "0.3.27" +version = "0.3.28" [deps.LogExpFunctions.extensions] LogExpFunctionsChainRulesCoreExt = "ChainRulesCore" @@ -819,15 +987,15 @@ version = "0.5.13" [[deps.Makie]] deps = ["Animations", "Base64", "CRC32c", "ColorBrewer", "ColorSchemes", "ColorTypes", "Colors", "Contour", "Dates", "DelaunayTriangulation", "Distributions", "DocStringExtensions", "Downloads", "FFMPEG_jll", "FileIO", "FilePaths", "FixedPointNumbers", "Format", "FreeType", "FreeTypeAbstraction", "GeometryBasics", "GridLayoutBase", "ImageIO", "InteractiveUtils", "IntervalSets", "Isoband", "KernelDensity", "LaTeXStrings", "LinearAlgebra", "MacroTools", "MakieCore", "Markdown", "MathTeXEngine", "Observables", "OffsetArrays", "Packing", "PlotUtils", "PolygonOps", "PrecompileTools", "Printf", "REPL", "Random", "RelocatableFolders", "Scratch", "ShaderAbstractions", "Showoff", "SignedDistanceFields", "SparseArrays", "Statistics", "StatsBase", "StatsFuns", "StructArrays", "TriplotBase", "UnicodeFun", "Unitful"] -git-tree-sha1 = "e96f6e1dba3c008d95b97103a330be6287411c67" +git-tree-sha1 = "e11b0666b457e3bb60119f2ed4d063d2b68954d3" uuid = "ee78f7c6-11fb-53f2-987a-cfe4a2b5a57a" -version = "0.21.0" +version = "0.21.3" [[deps.MakieCore]] deps = ["ColorTypes", "GeometryBasics", "IntervalSets", "Observables"] -git-tree-sha1 = "f23e301d977e037ff8df4e1f5d8035cd78a1e250" +git-tree-sha1 = "638bc817096742e8302f7b0b972ee5701fe00e97" uuid = "20f20a25-4f0e-4fdf-b5d1-57303727442b" -version = "0.8.0" +version = "0.8.3" [[deps.MappedArrays]] git-tree-sha1 = "2dab0221fe2b0f2cb6754eaa743cc266339f527e" @@ -886,6 +1054,18 @@ git-tree-sha1 = "f5db02ae992c260e4826fe78c942954b48e1d9c2" uuid = "99f44e22-a591-53d1-9472-aa23ef4bd671" version = "1.2.1" +[[deps.MultivariatePolynomials]] +deps = ["ChainRulesCore", "DataStructures", "LinearAlgebra", "MutableArithmetics"] +git-tree-sha1 = "5c1d1d9361e1417e5a065e1f84dc3686cbdaea21" +uuid = "102ac46a-7ee4-5c85-9060-abc95bfdeaa3" +version = "0.5.6" + +[[deps.MutableArithmetics]] +deps = ["LinearAlgebra", "SparseArrays", "Test"] +git-tree-sha1 = "898c56fbf8bf71afb0c02146ef26f3a454e88873" +uuid = "d8a4904e-b15c-11e9-3269-09a3773c0cb0" +version = "1.4.5" + [[deps.NaNMath]] deps = ["OpenLibm_jll"] git-tree-sha1 = "0877504529a3e5c3343c6f8b4c0381e57e4387e4" @@ -952,9 +1132,9 @@ version = "1.4.3" [[deps.OpenSSL_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl"] -git-tree-sha1 = "3da7367955dcc5c54c1ba4d402ccdc09a1a3e046" +git-tree-sha1 = "a028ee3cb5641cccc4c24e90c36b0a4f7707bdf5" uuid = "458c3c95-2e84-50aa-8efc-19380b2a3a95" -version = "3.0.13+1" +version = "3.0.14+0" [[deps.OpenSpecFun_jll]] deps = ["Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "Libdl", "Pkg"] @@ -1036,6 +1216,18 @@ git-tree-sha1 = "77b3d3605fc1cd0b42d95eba87dfcd2bf67d5ff6" uuid = "647866c9-e3ac-4575-94e7-e3d426903924" version = "0.1.2" +[[deps.PreallocationTools]] +deps = ["Adapt", "ArrayInterface", "ForwardDiff"] +git-tree-sha1 = "406c29a7f46706d379a3bce45671b4e3a39ddfbc" +uuid = "d236fae5-4411-538c-8e31-a6e3d9e00b46" +version = "0.4.22" + + [deps.PreallocationTools.extensions] + PreallocationToolsReverseDiffExt = "ReverseDiff" + + [deps.PreallocationTools.weakdeps] + ReverseDiff = "37e2e3b7-166d-5795-8a7a-e32c996b4267" + [[deps.PrecompileTools]] deps = ["Preferences"] git-tree-sha1 = "5aa36f7049a63a1528fe8f7c3f2113413ffd4e1f" @@ -1063,9 +1255,9 @@ uuid = "92933f4c-e287-5a05-a399-4b506db050ca" version = "1.10.0" [[deps.PtrArrays]] -git-tree-sha1 = "077664975d750757f30e739c870fbbdc01db7913" +git-tree-sha1 = "f011fbb92c4d401059b2212c05c0601b70f8b759" uuid = "43287f4e-b6f4-7ad1-bb20-aadabca52c3d" -version = "1.1.0" +version = "1.2.0" [[deps.QOI]] deps = ["ColorTypes", "FileIO", "FixedPointNumbers"] @@ -1120,6 +1312,30 @@ git-tree-sha1 = "5c3d09cc4f31f5fc6af001c250bf1278733100ff" uuid = "3cdcf5f2-1ef4-517c-9805-6587b60abb01" version = "1.3.4" +[[deps.RecursiveArrayTools]] +deps = ["Adapt", "ArrayInterface", "DocStringExtensions", "GPUArraysCore", "IteratorInterfaceExtensions", "LinearAlgebra", "RecipesBase", "SparseArrays", "StaticArraysCore", "Statistics", "SymbolicIndexingInterface", "Tables"] +git-tree-sha1 = "3400ce27995422fb88ffcd3af9945565aad947f0" +uuid = "731186ca-8d62-57ce-b412-fbd966d074cd" +version = "3.23.1" + + [deps.RecursiveArrayTools.extensions] + RecursiveArrayToolsFastBroadcastExt = "FastBroadcast" + RecursiveArrayToolsForwardDiffExt = "ForwardDiff" + RecursiveArrayToolsMeasurementsExt = "Measurements" + RecursiveArrayToolsMonteCarloMeasurementsExt = "MonteCarloMeasurements" + RecursiveArrayToolsReverseDiffExt = ["ReverseDiff", "Zygote"] + RecursiveArrayToolsTrackerExt = "Tracker" + RecursiveArrayToolsZygoteExt = "Zygote" + + [deps.RecursiveArrayTools.weakdeps] + FastBroadcast = "7034ab61-46d4-4ed7-9d0f-46aef9175898" + ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210" + Measurements = "eff96d63-e80a-5855-80a2-b1b0885c5ab7" + MonteCarloMeasurements = "0987c9cc-fe09-11e8-30f0-b96dd679fdca" + ReverseDiff = "37e2e3b7-166d-5795-8a7a-e32c996b4267" + Tracker = "9f7883ad-71c0-57eb-9f7f-b5c9e6d3789c" + Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f" + [[deps.Reexport]] git-tree-sha1 = "45e428421666073eab6f2da5c9d310d99bb12f9b" uuid = "189a3867-3050-52da-a836-e630ba90ab69" @@ -1150,16 +1366,16 @@ uuid = "79098fc4-a85e-5d69-aa6a-4863f24498fa" version = "0.7.1" [[deps.Rmath_jll]] -deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"] -git-tree-sha1 = "6ed52fdd3382cf21947b15e8870ac0ddbff736da" +deps = ["Artifacts", "JLLWrappers", "Libdl"] +git-tree-sha1 = "d483cd324ce5cf5d61b77930f0bbd6cb61927d21" uuid = "f50d1b31-88e8-58de-be2c-1cc44531875f" -version = "0.4.0+0" +version = "0.4.2+0" [[deps.Rotations]] deps = ["LinearAlgebra", "Quaternions", "Random", "StaticArrays"] -git-tree-sha1 = "2a0a5d8569f481ff8840e3b7c84bbf188db6a3fe" +git-tree-sha1 = "5680a9276685d392c87407df00d57c9924d9f11e" uuid = "6038ab10-8711-5258-84ad-4b1120ba62dc" -version = "1.7.0" +version = "1.7.1" weakdeps = ["RecipesBase"] [deps.Rotations.extensions] @@ -1170,6 +1386,12 @@ git-tree-sha1 = "40b9edad2e5287e05bd413a38f61a8ff55b9557b" uuid = "5eaf0fd0-dfba-4ccb-bf02-d820a40db705" version = "0.2.1" +[[deps.RuntimeGeneratedFunctions]] +deps = ["ExprTools", "SHA", "Serialization"] +git-tree-sha1 = "04c968137612c4a5629fa531334bb81ad5680f00" +uuid = "7e49a35a-f44a-4d26-94aa-eba1b4ca6b47" +version = "0.5.13" + [[deps.SHA]] uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce" version = "0.7.0" @@ -1180,6 +1402,43 @@ git-tree-sha1 = "2803cab51702db743f3fda07dd1745aadfbf43bd" uuid = "fdea26ae-647d-5447-a871-4b548cad5224" version = "3.5.0" +[[deps.SciMLBase]] +deps = ["ADTypes", "Accessors", "ArrayInterface", "CommonSolve", "ConstructionBase", "Distributed", "DocStringExtensions", "EnumX", "FunctionWrappersWrappers", "IteratorInterfaceExtensions", "LinearAlgebra", "Logging", "Markdown", "PrecompileTools", "Preferences", "Printf", "RecipesBase", "RecursiveArrayTools", "Reexport", "RuntimeGeneratedFunctions", "SciMLOperators", "SciMLStructures", "StaticArraysCore", "Statistics", "SymbolicIndexingInterface", "Tables"] +git-tree-sha1 = "7a6c5c8c38d2e37f45d4686c3598c20c1aebf48e" +uuid = "0bca4576-84f4-4d90-8ffe-ffa030f20462" +version = "2.41.3" + + [deps.SciMLBase.extensions] + SciMLBaseChainRulesCoreExt = "ChainRulesCore" + SciMLBaseMakieExt = "Makie" + SciMLBasePartialFunctionsExt = "PartialFunctions" + SciMLBasePyCallExt = "PyCall" + SciMLBasePythonCallExt = "PythonCall" + SciMLBaseRCallExt = "RCall" + SciMLBaseZygoteExt = "Zygote" + + [deps.SciMLBase.weakdeps] + ChainRules = "082447d4-558c-5d27-93f4-14fc19e9eca2" + ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" + Makie = "ee78f7c6-11fb-53f2-987a-cfe4a2b5a57a" + PartialFunctions = "570af359-4316-4cb7-8c74-252c00c2016b" + PyCall = "438e738f-606a-5dbb-bf0a-cddfbfd45ab0" + PythonCall = "6099a3de-0909-46bc-b1f4-468b9a2dfc0d" + RCall = "6f49c342-dc21-5d91-9882-a32aef131414" + Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f" + +[[deps.SciMLOperators]] +deps = ["ArrayInterface", "DocStringExtensions", "LinearAlgebra", "MacroTools", "Setfield", "SparseArrays", "StaticArraysCore"] +git-tree-sha1 = "10499f619ef6e890f3f4a38914481cc868689cd5" +uuid = "c0aeaf25-5076-4817-a8d5-81caf7dfa961" +version = "0.3.8" + +[[deps.SciMLStructures]] +deps = ["ArrayInterface"] +git-tree-sha1 = "6ab4beaf88dcdd2639bead916f2347f81dcacd0e" +uuid = "53ae85a6-f571-4167-b2af-e1d143709226" +version = "1.3.0" + [[deps.Scratch]] deps = ["Dates"] git-tree-sha1 = "3bac05bc7e74a75fd9cba4295cde4045d9fe2386" @@ -1189,6 +1448,12 @@ version = "1.2.1" [[deps.Serialization]] uuid = "9e88b42a-f829-5b0c-bbe9-9e923198166b" +[[deps.Setfield]] +deps = ["ConstructionBase", "Future", "MacroTools", "StaticArraysCore"] +git-tree-sha1 = "e2cc6d8c88613c05e1defb55170bf5ff211fbeac" +uuid = "efcf1570-3423-57d1-acb7-fd33fddbac46" +version = "1.1.1" + [[deps.ShaderAbstractions]] deps = ["ColorTypes", "FixedPointNumbers", "GeometryBasics", "LinearAlgebra", "Observables", "StaticArrays", "StructArrays", "Tables"] git-tree-sha1 = "79123bc60c5507f035e6d1d9e563bb2971954ec8" @@ -1260,9 +1525,9 @@ version = "0.1.1" [[deps.StaticArrays]] deps = ["LinearAlgebra", "PrecompileTools", "Random", "StaticArraysCore"] -git-tree-sha1 = "9ae599cd7529cfce7fea36cf00a62cfc56f0f37c" +git-tree-sha1 = "6e00379a24597be4ae1ee6b2d882e15392040132" uuid = "90137ffa-7385-5640-81b9-e52037218182" -version = "1.9.4" +version = "1.9.5" weakdeps = ["ChainRulesCore", "Statistics"] [deps.StaticArrays.extensions] @@ -1270,9 +1535,9 @@ weakdeps = ["ChainRulesCore", "Statistics"] StaticArraysStatisticsExt = "Statistics" [[deps.StaticArraysCore]] -git-tree-sha1 = "36b3d696ce6366023a0ea192b4cd442268995a0d" +git-tree-sha1 = "192954ef1208c7019899fbf8049e717f92959682" uuid = "1e83bf80-4336-4d27-bf5d-d5a4f845583c" -version = "1.4.2" +version = "1.4.3" [[deps.Statistics]] deps = ["LinearAlgebra", "SparseArrays"] @@ -1296,20 +1561,18 @@ deps = ["HypergeometricFunctions", "IrrationalConstants", "LogExpFunctions", "Re git-tree-sha1 = "cef0472124fab0695b58ca35a77c6fb942fdab8a" uuid = "4c63d2b9-4356-54db-8cca-17b64c39e42c" version = "1.3.1" +weakdeps = ["ChainRulesCore", "InverseFunctions"] [deps.StatsFuns.extensions] StatsFunsChainRulesCoreExt = "ChainRulesCore" StatsFunsInverseFunctionsExt = "InverseFunctions" - [deps.StatsFuns.weakdeps] - ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4" - InverseFunctions = "3587e190-3f89-42d0-90ee-14403ec27112" - [[deps.StructArrays]] deps = ["ConstructionBase", "DataAPI", "Tables"] git-tree-sha1 = "f4dc295e983502292c4c3f951dbb4e985e35b3be" uuid = "09ab397b-f2b6-538f-b94a-2f83cf4a842a" version = "0.6.18" +weakdeps = ["Adapt", "GPUArraysCore", "SparseArrays", "StaticArrays"] [deps.StructArrays.extensions] StructArraysAdaptExt = "Adapt" @@ -1317,12 +1580,6 @@ version = "0.6.18" StructArraysSparseArraysExt = "SparseArrays" StructArraysStaticArraysExt = "StaticArrays" - [deps.StructArrays.weakdeps] - Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e" - GPUArraysCore = "46192b85-c4d5-4398-a991-12ede77f4527" - SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf" - StaticArrays = "90137ffa-7385-5640-81b9-e52037218182" - [[deps.SuiteSparse]] deps = ["Libdl", "LinearAlgebra", "Serialization", "SparseArrays"] uuid = "4607b0f0-06f3-5cda-b6b1-a6196a1729e9" @@ -1332,6 +1589,42 @@ deps = ["Artifacts", "Libdl", "libblastrampoline_jll"] uuid = "bea87d4a-7f5b-5778-9afe-8cc45184846c" version = "7.2.1+1" +[[deps.SymbolicIndexingInterface]] +deps = ["Accessors", "ArrayInterface", "RuntimeGeneratedFunctions", "StaticArraysCore"] +git-tree-sha1 = "a5f6f138b740c9d93d76f0feddd3092e6ef002b7" +uuid = "2efcf032-c050-4f8e-a9bb-153293bab1f5" +version = "0.3.22" + +[[deps.SymbolicLimits]] +deps = ["SymbolicUtils"] +git-tree-sha1 = "fb099adbd7504f1e68b4512828e9d94197a8b889" +uuid = "19f23fe9-fdab-4a78-91af-e7b7767979c3" +version = "0.2.1" + +[[deps.SymbolicUtils]] +deps = ["AbstractTrees", "Bijections", "ChainRulesCore", "Combinatorics", "ConstructionBase", "DataStructures", "DocStringExtensions", "DynamicPolynomials", "IfElse", "LabelledArrays", "LinearAlgebra", "MultivariatePolynomials", "NaNMath", "Setfield", "SparseArrays", "SpecialFunctions", "StaticArrays", "SymbolicIndexingInterface", "TermInterface", "TimerOutputs", "Unityper"] +git-tree-sha1 = "79813de27af70906d223fbd89ad90dba3d88a2b0" +uuid = "d1185830-fcd6-423d-90d6-eec64667417b" +version = "2.0.2" + +[[deps.Symbolics]] +deps = ["ADTypes", "ArrayInterface", "Bijections", "ConstructionBase", "DataStructures", "DiffRules", "Distributions", "DocStringExtensions", "DomainSets", "DynamicPolynomials", "ForwardDiff", "IfElse", "LaTeXStrings", "LambertW", "Latexify", "Libdl", "LinearAlgebra", "LogExpFunctions", "MacroTools", "Markdown", "NaNMath", "PrecompileTools", "RecipesBase", "Reexport", "Requires", "RuntimeGeneratedFunctions", "SciMLBase", "Setfield", "SparseArrays", "SpecialFunctions", "StaticArrays", "SymbolicIndexingInterface", "SymbolicLimits", "SymbolicUtils", "TermInterface"] +git-tree-sha1 = "3669f8eba2720c595e16b038f33cb880c12ef7f7" +uuid = "0c5d862f-8b57-4792-8d23-62f2024744c7" +version = "5.30.3" + + [deps.Symbolics.extensions] + SymbolicsGroebnerExt = "Groebner" + SymbolicsLuxCoreExt = "LuxCore" + SymbolicsPreallocationToolsExt = "PreallocationTools" + SymbolicsSymPyExt = "SymPy" + + [deps.Symbolics.weakdeps] + Groebner = "0b43b601-686d-58a3-8a1c-6623616c7cd4" + LuxCore = "bb33d45b-7691-41d6-9220-0943567d0623" + PreallocationTools = "d236fae5-4411-538c-8e31-a6e3d9e00b46" + SymPy = "24249f21-da20-56a4-8eb1-6a02cf4ae2e6" + [[deps.TOML]] deps = ["Dates"] uuid = "fa267f1f-6049-4f14-aa54-33bafae1ed76" @@ -1360,6 +1653,11 @@ git-tree-sha1 = "1feb45f88d133a655e001435632f019a9a1bcdb6" uuid = "62fd8b95-f654-4bbd-a8a5-9c27f68ccd50" version = "0.1.1" +[[deps.TermInterface]] +git-tree-sha1 = "6f0cee95e74d1f6891ba6b35b8b219fd3d11b567" +uuid = "8ea1fca8-c5ef-4a55-8b96-4e9afe9c9a3c" +version = "0.4.1" + [[deps.Test]] deps = ["InteractiveUtils", "Logging", "Random", "Serialization"] uuid = "8dfed614-e22c-5e08-85e1-65c5234f0b40" @@ -1376,10 +1674,16 @@ git-tree-sha1 = "bc7fd5c91041f44636b2c134041f7e5263ce58ae" uuid = "731e570b-9d59-4bfa-96dc-6df516fadf69" version = "0.10.0" +[[deps.TimerOutputs]] +deps = ["ExprTools", "Printf"] +git-tree-sha1 = "5a13ae8a41237cff5ecf34f73eb1b8f42fff6531" +uuid = "a759f4b9-e2f1-59dc-863e-4aeb61b1ea8f" +version = "0.5.24" + [[deps.TranscodingStreams]] -git-tree-sha1 = "5d54d076465da49d6746c647022f3b3674e64156" +git-tree-sha1 = "a947ea21087caba0a798c5e494d0bb78e3a1a3a0" uuid = "3bb67fe8-82b1-5028-8e26-92a6c54297fa" -version = "0.10.8" +version = "0.10.9" weakdeps = ["Random", "Test"] [deps.TranscodingStreams.extensions] @@ -1413,20 +1717,23 @@ deps = ["Dates", "LinearAlgebra", "Random"] git-tree-sha1 = "dd260903fdabea27d9b6021689b3cd5401a57748" uuid = "1986cc42-f94f-5a68-af5c-568840ba703d" version = "1.20.0" +weakdeps = ["ConstructionBase", "InverseFunctions"] [deps.Unitful.extensions] ConstructionBaseUnitfulExt = "ConstructionBase" InverseFunctionsUnitfulExt = "InverseFunctions" - [deps.Unitful.weakdeps] - ConstructionBase = "187b0558-2788-49d3-abe0-74a17ed4e7c9" - InverseFunctions = "3587e190-3f89-42d0-90ee-14403ec27112" +[[deps.Unityper]] +deps = ["ConstructionBase"] +git-tree-sha1 = "25008b734a03736c41e2a7dc314ecb95bd6bbdb0" +uuid = "a7c27f48-0311-42f6-a7f8-2c11e75eb415" +version = "0.1.6" [[deps.WGLMakie]] deps = ["Bonito", "Colors", "FileIO", "FreeTypeAbstraction", "GeometryBasics", "Hyperscript", "LinearAlgebra", "Makie", "Observables", "PNGFiles", "PrecompileTools", "RelocatableFolders", "ShaderAbstractions", "StaticArrays"] -git-tree-sha1 = "8b0955907d236199ca7e8259aab5c8bb061de584" +git-tree-sha1 = "ba21aa663fb95ebf522377b62a9b4d85213f01e6" uuid = "276b4fcb-3e11-5398-bf8b-a0c2d153d008" -version = "0.10.0" +version = "0.10.3" [[deps.WidgetsBase]] deps = ["Observables"] @@ -1442,9 +1749,9 @@ version = "1.0.0" [[deps.XML2_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl", "Libiconv_jll", "Zlib_jll"] -git-tree-sha1 = "532e22cf7be8462035d092ff21fada7527e2c488" +git-tree-sha1 = "52ff2af32e591541550bd753c0da8b9bc92bb9d9" uuid = "02c8fc9c-b97f-50b9-bbe4-9be30ff0a78a" -version = "2.12.6+0" +version = "2.12.7+0" [[deps.XSLT_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl", "Libgcrypt_jll", "Libgpg_error_jll", "Libiconv_jll", "Pkg", "XML2_jll", "Zlib_jll"] diff --git a/examples/Project.toml b/examples/Project.toml index 3b09e3d..f90ca43 100644 --- a/examples/Project.toml +++ b/examples/Project.toml @@ -9,4 +9,5 @@ Makie = "ee78f7c6-11fb-53f2-987a-cfe4a2b5a57a" QuadGK = "1fd47b50-473d-5c70-9696-f719f8f3bcdc" Revise = "295af30f-e4ad-537b-8983-00126c2a3abe" StaticArrays = "90137ffa-7385-5640-81b9-e52037218182" +Symbolics = "0c5d862f-8b57-4792-8d23-62f2024744c7" WGLMakie = "276b4fcb-3e11-5398-bf8b-a0c2d153d008" diff --git a/examples/triangle_wave.jl b/examples/triangle_wave.jl index 878715a..87023fd 100644 --- a/examples/triangle_wave.jl +++ b/examples/triangle_wave.jl @@ -1,18 +1,25 @@ using Revise -using Descartes: Descartes, TriangleWave, FRep, Grid, PolarWarp, Cuboid -using WGLMakie, Makie +using Descartes: Descartes, TriangleWave, FRep, Grid, PolarWarp, Cuboid, union +using WGLMakie using CoordinateTransformations using StaticArrays using ForwardDiff using LinearAlgebra -t = TriangleWave(2.) +using Symbolics + +WGLMakie.activate!(resize_to=:body) + + +t1 = TriangleWave(2., 1) +t2 = TriangleWave(2., 2) x = 1:0.1:10 -y = [FRep(t, e) for e in x] +y1 = [FRep(t1, e) for e in x] +y2 = [FRep(t2, e) for e in x] -lines(x,y) +lines(x,y2) -g = Grid(Square([10, 10]), 1.0) +g = union(TriangleWave(1., 1), TriangleWave(2., 2)) x_vals = -10:0.1:10 y_vals = -10:0.1:10 @@ -22,14 +29,20 @@ z = [FRep(g, (x, y)) for x in x_vals, y in y_vals] extrema(z) heatmap(x_vals, y_vals, z, alpha=0.6) +@variables x y +FRep(g, (x, y)) # Apply warp g_polar = PolarWarp(g, 8) -z = [min(FRep(g_polar, (x, y))...) for x in x_vals, y in y_vals] +#FRep(g_polar, (x, y)) + +z = [FRep(g_polar, (x, y)) for x in x_vals, y in y_vals] + extrema(z) -heatmap(x_vals, y_vals, z, alpha=0.6) +fig, ax, hm = heatmap(x_vals, y_vals, z, alpha=0.6) +Colorbar(fig[:, end+1], hm) polar_f(v) = FRep(g_polar, v) diff --git a/src/Descartes.jl b/src/Descartes.jl index e6a0e39..dd1458e 100644 --- a/src/Descartes.jl +++ b/src/Descartes.jl @@ -12,6 +12,8 @@ using StaticArrays, CoordinateTransformations, Rotations +using ForwardDiff: gradient, jacobian + include("types.jl") include("utils.jl") include("constructors.jl") diff --git a/src/frep.jl b/src/frep.jl index 096246c..844c9a3 100644 --- a/src/frep.jl +++ b/src/frep.jl @@ -115,15 +115,25 @@ function FRep(p::LinearExtrude, v) end function FRep(t::TriangleWave, v) - abs(mod(v, t.period) - t.period / 2) + abs(mod(v[t.direction], t.period) - t.period / 2) end -function FRep(g::Grid, v) - minimum(FRep(TriangleWave(g.period), e) for e in v) -end function FRep(p::PolarWarp, v) - mr = hypot(v...) - mt = atan(v[2], v[1])*p.w/2π - [FRep(p.primitive, mr), FRep(p.primitive, mt)] + inner_warp(p.primitive, p.w, v) +end + +function inner_warp(p::AbstractPrimitive, w, v) + T(a) = SVector(hypot(a...), atan(a[2], a[1])*w/2π) #cartesian to polar + hr = gradient(a -> FRep(p, T(a)), SVector(v...)) + mr, mt = T(v) + FRep(p, SVector(mr, mt))/norm(hr) end + +function inner_warp(p::CSGUnion, w, v) + m = inner_warp(p.left, w, v) + for r in p.right + m = min(m, inner_warp(r, w, v)) + end + m +end \ No newline at end of file diff --git a/src/hyperrectangles.jl b/src/hyperrectangles.jl index 95f9d55..f31c504 100644 --- a/src/hyperrectangles.jl +++ b/src/hyperrectangles.jl @@ -59,10 +59,6 @@ function HyperRectangle(csg::CSGIntersect) h end -function HyperRectangle(g::Grid{T}) where T - HyperRectangle(Vec(-100,100), Vec(200,200)) -end - function HyperRectangle(csg::CSGDiff) HyperRectangle(csg.left) end @@ -101,6 +97,10 @@ function intersect(h1::HyperRectangle, h2::HyperRectangle) HyperRectangle(m, mm - m) end +function intersect(::Nothing, h1::HyperRectangle) + h1 +end + function Base.intersect(h1::HyperRectangle, ::Nothing) h1 end \ No newline at end of file diff --git a/src/meshes.jl b/src/meshes.jl index 7718602..258cc37 100644 --- a/src/meshes.jl +++ b/src/meshes.jl @@ -1,7 +1,7 @@ -function (::Type{MT})(primitives::AbstractPrimitive{3, T}...; +function (::Type{MT})(primitives::AbstractPrimitive...; samples=(128,128,128), algorithm=MarchingCubes(), - adf=false) where {T, MT <: AbstractMesh} + adf=false) where {MT <: AbstractMesh} f(x) = FRep(primitives[1], x) meshes = Vector{MT}(undef, length(primitives)) diff --git a/src/types.jl b/src/types.jl index 8003eb2..d3f810e 100644 --- a/src/types.jl +++ b/src/types.jl @@ -86,17 +86,9 @@ struct LinearExtrude{N, T, P} <: AbstractPrimitive{3,T} distance::T end -struct TriangleWave{T} - period::T -end - -""" - Grid{T} - -A simple grid structure with a `period` field of type `T`. -""" -struct Grid{T} <: AbstractPrimitive{2, T} +struct TriangleWave{T} <: AbstractPrimitive{2, T} period::T + direction::Int end struct PolarWarp{T} <: AbstractPrimitive{2, T} diff --git a/test/runtests.jl b/test/runtests.jl index 89238e0..b30ccb1 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1,4 +1,4 @@ -using Descartes: Sphere, Cuboid, Cylinder, CSGUnion, CSGIntersect, CSGDiff, MapContainer, Piping, FRep, Square, Circle, translate, rotate, Shell, RadiusedCSGUnion, LinearExtrude +using Descartes: Descartes, Sphere, Cuboid, Cylinder, CSGUnion, CSGIntersect, CSGDiff, MapContainer, Piping, FRep, Square, Circle, translate, rotate, Shell, RadiusedCSGUnion, LinearExtrude using StaticArrays using Test using Combinatorics @@ -18,3 +18,9 @@ include("hyperrectangles.jl") include("meshes.jl") include("examples.jl") include("frep.jl") + + +using Aqua +@testset "Aqua" begin + Aqua.test_all(Descartes; ambiguities=false, piracies=false) +end \ No newline at end of file