Line data Source code
1 : """ 2 : mesh = readobjmesh(io, template::Mesh[; 3 : real_type=Float64, index_type=Int32, 4 : color_type=RGBA, 5 : position=Val(:x), normal=Val(:n), 6 : texcoord=Val(:u), color=Val(:c)) 7 : 8 : Read `mesh` of same type as `template` from OBJ data steam `io`. 9 : 10 : - `real_type`, `index_type` and `color_type` are used by [`OBJBuffer`](@ref) 11 : - `position`, `normal`, `texcoord` and `color` denote attributes in 12 : `mesh`, which may or may not exist or may be disabled. 13 : 14 : !!! note 15 : This method is called by [`readmesh`](@ref) 16 : 17 : See also [`readmesh`](@ref), [`OBJBuffer`](@ref), [`readobj`](@ref) 18 : """ 19 6 : function readobjmesh(io::IO, 20 : template::Mesh=createmesh(OBJ()); 21 : real_type=Float64, index_type=Int32, color_type=RGBA, 22 : position=Val(:x), normal=Val(:n), 23 : texcoord=Val(:u), color=Val(:c)) 24 : 25 3 : buffer = readobj(io; real_type, index_type, color_type) 26 3 : createmesh(buffer; template, position, normal, texcoord, color) 27 : end