Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/lowering.jl
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ function lower(material::GenericMaterial)
if material.map !== nothing
data["map"] = lower(material.map)
end
merge!(data, material.kwargs)
data
end

Expand Down Expand Up @@ -363,6 +364,7 @@ function lower(cloud::FatLineGeometry)
if !isempty(cloud.color)
data["color"] = lower(convert(Vector{RGB{Float32}}, cloud.color))
end
merge!(data, cloud.kwargs)
data
end

Expand All @@ -384,5 +386,6 @@ function lower(material::FatLineMaterial)
data["dashSize"] = material.dashSize
data["gapSize"] = material.gapSize
end
merge!(data, material.kwargs)
data
end
4 changes: 4 additions & 0 deletions src/objects.jl
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ PngImage(fname::AbstractString) = PngImage(open(read, fname))
image::PngImage
wrap::Tuple{Int, Int} = (1001, 1001) # TODO: replace with enum
repeat::Tuple{Int, Int} = (1, 1) # TODO: what does this mean?
kwargs::Dict{String, Any} = Dict{String, Any}()
end

@with_kw mutable struct GenericMaterial <: AbstractMaterial
Expand All @@ -59,6 +60,7 @@ end
side::Int = 2 # TODO: make an enum https://github.com/mrdoob/three.js/blob/d55897b8e9b2632896d8ac146a05b3b4be3668f8/src/constants.js#L14
wireframe::Bool = false
wireframeLinewidth::Float64 = 1
kwargs::Dict{String, Any} = Dict{String, Any}()
end

threejs_type(m::GenericMaterial) = m._type
Expand All @@ -72,6 +74,7 @@ LineBasicMaterial(;kw...) = GenericMaterial(_type="LineBasicMaterial"; kw...)
color::RGBA{Float32}=RGB(1., 1., 1.)
size::Float32 = 0.002
vertexColors::Int = 2
kwargs::Dict{String, Any} = Dict{String, Any}()
end

"""
Expand Down Expand Up @@ -116,6 +119,7 @@ See also: [`FatLineGeometry`](@ref), [`FatLine`](@ref)
dashSize::Float64 = 1.0
gapSize::Float64 = 1.0
worldUnits::Bool = false
kwargs::Dict{String, Any} = Dict{String, Any}()
end

"""
Expand Down