MCPcopy Create free account
hub / github.com/PyMesh/PyMesh / create

Method create

tools/Wires/Inflator/WireProfile.cpp:125–146  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

123using namespace WireProfileHelper;
124
125WireProfile::Ptr WireProfile::create(const std::string& name) {
126 if (name == "square") {
127 MatrixFr loop(4,3);
128 loop << -1, -1, 0,
129 1, -1, 0,
130 1, 1, 0,
131 -1, 1, 0;
132 Ptr r = Ptr(new WireProfile());
133 r->initialize(loop);
134 return r;
135 } else if (name == "hexagon") {
136 return WireProfile::create_isotropic(6);
137 } else if (name == "octagon") {
138 return WireProfile::create_isotropic(8);
139 } else if (name == "triangle") {
140 return WireProfile::create_isotropic(3);
141 } else {
142 std::stringstream err_msg;
143 err_msg << "Unknown loop profile: " << name;
144 throw NotImplementedError(err_msg.str());
145 }
146}
147
148WireProfile::Ptr WireProfile::create_isotropic(size_t num_samples) {
149 MatrixFr loop = MatrixFr::Zero(num_samples, 3);

Callers 4

save_meshFunction · 0.45
save_meshMethod · 0.45
update_meshMethod · 0.45

Calls 3

NotImplementedErrorClass · 0.85
initializeMethod · 0.45
strMethod · 0.45

Tested by

no test coverage detected