Manifold 1.0
Robust computational geometry
 
Loading...
Searching...
No Matches
meshIO.h
1// Copyright 2021 The Manifold Authors.
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15#pragma once
16#include <string>
17
18#include "manifold/manifold.h"
19
20namespace manifold {
21
30struct Material {
32 double roughness = 0.2;
34 double metalness = 1;
37 vec4 color = vec4(1.0);
41 std::vector<vec4> vertColor;
48};
49
56 bool faceted = true;
59};
60
61MeshGL ImportMesh(const std::string& filename, bool forceCleanup = false);
62
63void ExportMesh(const std::string& filename, const MeshGL& mesh,
64 const ExportOptions& options);
66} // namespace manifold
ivec4 colorChannels
Definition meshIO.h:47
bool faceted
Definition meshIO.h:56
double metalness
Metalness value, generally either 0 (dielectric) or 1 (metal).
Definition meshIO.h:34
std::vector< vec4 > vertColor
Definition meshIO.h:41
vec4 color
Definition meshIO.h:37
double roughness
Roughness value between 0 (shiny) and 1 (matte).
Definition meshIO.h:32
Material mat
PBR material properties.
Definition meshIO.h:58
ivec3 normalChannels
Definition meshIO.h:44
void ExportMesh(const std::string &filename, const MeshGL &mesh, const ExportOptions &options)
Definition meshIO.cpp:185
MeshGL ImportMesh(const std::string &filename, bool forceCleanup=false)
Definition meshIO.cpp:114
Definition meshIO.h:53
Definition meshIO.h:30
Definition common.h:22
MeshGLP< float > MeshGL
Definition manifold.h:129