Manifold 3.0
Robust 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
31struct Material {
33 double roughness = 0.2;
35 double metalness = 1;
38 vec3 color = vec3(1.0);
41 int alpha = 1.0;
45 int normalIdx = -1;
49 int colorIdx = -1;
53 int alphaIdx = -1;
54};
55
62 bool faceted = true;
65};
66
67MeshGL ImportMesh(const std::string& filename, bool forceCleanup = false);
68
69void ExportMesh(const std::string& filename, const MeshGL& mesh,
70 const ExportOptions& options);
72} // namespace manifold
MeshGLP< float > MeshGL
Single-precision - ideal for most uses, especially graphics.
Definition manifold.h:165
int alphaIdx
Definition meshIO.h:53
vec3 color
Definition meshIO.h:38
bool faceted
Definition meshIO.h:62
double metalness
Metalness value, generally either 0 (dielectric) or 1 (metal).
Definition meshIO.h:35
int normalIdx
Definition meshIO.h:45
int alpha
Definition meshIO.h:41
double roughness
Roughness value between 0 (shiny) and 1 (matte).
Definition meshIO.h:33
Material mat
PBR material properties.
Definition meshIO.h:64
int colorIdx
Definition meshIO.h:49
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:59
Definition meshIO.h:31