From f7caf0db07266a6ec4f7518143028ec0bc93e5d7 Mon Sep 17 00:00:00 2001 From: Ian Chua Date: Thu, 23 Jul 2026 21:04:08 +0800 Subject: [PATCH 1/5] feat(plugin): storage API --- src/slic3r/plugin/host/PluginHost.cpp | 51 +++++++++++++++++++ src/slic3r/plugin/host/PluginHostBindings.hpp | 2 +- 2 files changed, 52 insertions(+), 1 deletion(-) diff --git a/src/slic3r/plugin/host/PluginHost.cpp b/src/slic3r/plugin/host/PluginHost.cpp index 524f07f12c..5fca4d4fbc 100644 --- a/src/slic3r/plugin/host/PluginHost.cpp +++ b/src/slic3r/plugin/host/PluginHost.cpp @@ -1,9 +1,59 @@ #include "PluginHost.hpp" #include "PluginHostBindings.hpp" #include "PluginHostUi.hpp" +#include +#include +#include +#include +#include + +#include namespace Slic3r { +namespace host_bindings { +void register_plugin(pybind11::module_& host) +{ + auto plugin_host = host.def_submodule("plugin", "Plugin host API"); + + plugin_host.def( + "storage", + []() -> std::string { + const std::string plugin_key = PluginAuditManager::instance().current_plugin(); + if (plugin_key.empty()) + throw std::runtime_error("plugin.storage() must be called from a plugin callback"); + + PluginDescriptor descriptor; + if (!PluginManager::instance().try_get_plugin_descriptor(plugin_key, descriptor)) + throw std::runtime_error("The current plugin is not registered"); + + // plugin_root is populated for installed packages. If it is unavailable, the entry + // path still identifies the same package directory. This is important for local + // plugins: their directory is based on the source filename (including its extension), + // while plugin_key is based on the filename stem. + const boost::filesystem::path plugin_root = resolve_plugin_root_from_descriptor(descriptor); + if (!plugin_root.empty()) + return plugin_root.string(); + + if (!descriptor.is_cloud_plugin()) + throw std::runtime_error("The current local plugin folder is unavailable"); + + if (wxTheApp == nullptr || GUI::wxGetApp().getAgent() == nullptr) + throw std::runtime_error("Cloud plugin storage is unavailable before networking is initialized"); + + const std::string user_id = GUI::wxGetApp().getAgent()->get_user_id(); + if (user_id.empty()) + throw std::runtime_error("Cloud plugin storage is unavailable without a logged-in user"); + + if (!is_valid_plugin_id(plugin_key)) + throw std::runtime_error("The current cloud plugin key is not a valid folder name"); + + return (boost::filesystem::path(get_cloud_plugin_dir(user_id)) / plugin_key).string(); + }, + "Return the installed folder of the current plugin."); +} +} // namespace host_bindings + void PluginHost::RegisterBindings(pybind11::module_& module) { auto host = module.def_submodule("host", "Host application API"); @@ -15,6 +65,7 @@ void PluginHost::RegisterBindings(pybind11::module_& module) host_bindings::register_presets(host); host_bindings::register_model(host); host_bindings::register_app(host); + host_bindings::register_plugin(host); // UI: native dialogs and interactive HTML windows for plugins. PluginHostUi::RegisterBindings(host); diff --git a/src/slic3r/plugin/host/PluginHostBindings.hpp b/src/slic3r/plugin/host/PluginHostBindings.hpp index 0f206d5992..94601ad99c 100644 --- a/src/slic3r/plugin/host/PluginHostBindings.hpp +++ b/src/slic3r/plugin/host/PluginHostBindings.hpp @@ -12,5 +12,5 @@ void register_presets(pybind11::module_& host); // PluginHostPresets.cpp void register_model(pybind11::module_& host); // PluginHostModel.cpp void register_app(pybind11::module_& host); // PluginHostApp.cpp void register_slicing(pybind11::module_& host); // PluginHostSlicing.cpp - +void register_plugin(pybind11::module_& host); // PluginHost.cpp } // namespace Slic3r::host_bindings From 2e246341d16bc655f409d2882365508b020c097b Mon Sep 17 00:00:00 2001 From: Ian Chua Date: Fri, 24 Jul 2026 18:57:46 +0800 Subject: [PATCH 2/5] move the storage directory outside the actual plugin code folder --- src/slic3r/plugin/PluginFsUtils.cpp | 2 +- src/slic3r/plugin/PluginFsUtils.hpp | 1 + src/slic3r/plugin/PluginManager.cpp | 32 +++++++++++++++++++++++++++ src/slic3r/plugin/PluginManager.hpp | 4 ++++ src/slic3r/plugin/host/PluginHost.cpp | 30 +------------------------ 5 files changed, 39 insertions(+), 30 deletions(-) diff --git a/src/slic3r/plugin/PluginFsUtils.cpp b/src/slic3r/plugin/PluginFsUtils.cpp index 445dd00b9b..63dc229967 100644 --- a/src/slic3r/plugin/PluginFsUtils.cpp +++ b/src/slic3r/plugin/PluginFsUtils.cpp @@ -632,7 +632,7 @@ void parse_metadata_rfc822(const std::string& content, bool is_ignored_plugin_directory(const boost::filesystem::path& path) { const std::string name = path.filename().string(); - return name.empty() || name[0] == '.' || name.rfind("__", 0) == 0 || name == PLUGIN_SUBSCRIBED_DIR; + return name.empty() || name[0] == '.' || name.rfind("__", 0) == 0 || name == PLUGIN_SUBSCRIBED_DIR || name == PLUGIN_DATA_DIR; } bool is_safe_relative_path(const boost::filesystem::path& path) diff --git a/src/slic3r/plugin/PluginFsUtils.hpp b/src/slic3r/plugin/PluginFsUtils.hpp index 7922946b1c..5f57dbf807 100644 --- a/src/slic3r/plugin/PluginFsUtils.hpp +++ b/src/slic3r/plugin/PluginFsUtils.hpp @@ -12,6 +12,7 @@ #include #define PLUGIN_SUBSCRIBED_DIR "_subscribed" +#define PLUGIN_DATA_DIR "plugin_data" namespace Slic3r { diff --git a/src/slic3r/plugin/PluginManager.cpp b/src/slic3r/plugin/PluginManager.cpp index 761a9aad63..abc2446d55 100644 --- a/src/slic3r/plugin/PluginManager.cpp +++ b/src/slic3r/plugin/PluginManager.cpp @@ -486,6 +486,38 @@ bool PluginManager::try_get_plugin_descriptor_for_capability(const std::string& return false; } +std::string PluginManager::get_storage_dir(const std::string& plugin_key) const +{ + namespace fs = boost::filesystem; + + PluginDescriptor descriptor; + if (!try_get_plugin_descriptor(plugin_key, descriptor)) + throw std::runtime_error("The current plugin is not registered"); + + const fs::path base_storage_dir = fs::path(get_orca_plugins_dir()) / PLUGIN_DATA_DIR; + + if (!descriptor.is_cloud_plugin()) { + const fs::path local_storage_dir = base_storage_dir / plugin_key; + fs::create_directories(local_storage_dir); + return local_storage_dir.string(); + } + + auto agent = m_cloud_service.get_cloud_agent(); + if (!agent) + throw std::runtime_error("Cloud plugin storage is unavailable before networking is initialized"); + + const std::string user_id = agent->get_user_id(); + if (user_id.empty()) + throw std::runtime_error("Cloud plugin storage is unavailable without a logged-in user"); + + if (!is_valid_plugin_id(plugin_key)) + throw std::runtime_error("The current cloud plugin key is not a valid folder name"); + + const fs::path cloud_storage_dir = base_storage_dir / PLUGIN_SUBSCRIBED_DIR / user_id / plugin_key; + fs::create_directories(cloud_storage_dir); + return cloud_storage_dir.string(); +} + // ── Capability instances ──────────────────────────────────────────────────────────────────── std::vector> PluginManager::get_plugin_capabilities(const std::string& plugin_key, diff --git a/src/slic3r/plugin/PluginManager.hpp b/src/slic3r/plugin/PluginManager.hpp index 59a2791355..a0bab2afe3 100644 --- a/src/slic3r/plugin/PluginManager.hpp +++ b/src/slic3r/plugin/PluginManager.hpp @@ -138,6 +138,10 @@ public: bool try_get_plugin_descriptor_for_capability(const std::string& capability_name, PluginCapabilityType type, PluginDescriptor& out) const; + // Per-plugin storage directory under orca_plugins/plugin_data, created if missing. Throws + // std::runtime_error if the plugin is unregistered, the key is invalid, or (cloud plugins) + // no user is logged in yet. + std::string get_storage_dir(const std::string& plugin_key) const; std::vector> get_plugin_capabilities( const std::string& plugin_key = "", // "" => all plugins diff --git a/src/slic3r/plugin/host/PluginHost.cpp b/src/slic3r/plugin/host/PluginHost.cpp index 5fca4d4fbc..2830d6f276 100644 --- a/src/slic3r/plugin/host/PluginHost.cpp +++ b/src/slic3r/plugin/host/PluginHost.cpp @@ -2,10 +2,7 @@ #include "PluginHostBindings.hpp" #include "PluginHostUi.hpp" #include -#include -#include #include -#include #include @@ -23,32 +20,7 @@ void register_plugin(pybind11::module_& host) if (plugin_key.empty()) throw std::runtime_error("plugin.storage() must be called from a plugin callback"); - PluginDescriptor descriptor; - if (!PluginManager::instance().try_get_plugin_descriptor(plugin_key, descriptor)) - throw std::runtime_error("The current plugin is not registered"); - - // plugin_root is populated for installed packages. If it is unavailable, the entry - // path still identifies the same package directory. This is important for local - // plugins: their directory is based on the source filename (including its extension), - // while plugin_key is based on the filename stem. - const boost::filesystem::path plugin_root = resolve_plugin_root_from_descriptor(descriptor); - if (!plugin_root.empty()) - return plugin_root.string(); - - if (!descriptor.is_cloud_plugin()) - throw std::runtime_error("The current local plugin folder is unavailable"); - - if (wxTheApp == nullptr || GUI::wxGetApp().getAgent() == nullptr) - throw std::runtime_error("Cloud plugin storage is unavailable before networking is initialized"); - - const std::string user_id = GUI::wxGetApp().getAgent()->get_user_id(); - if (user_id.empty()) - throw std::runtime_error("Cloud plugin storage is unavailable without a logged-in user"); - - if (!is_valid_plugin_id(plugin_key)) - throw std::runtime_error("The current cloud plugin key is not a valid folder name"); - - return (boost::filesystem::path(get_cloud_plugin_dir(user_id)) / plugin_key).string(); + return PluginManager::instance().get_storage_dir(plugin_key); }, "Return the installed folder of the current plugin."); } From cbd1bf2c37adda529489eab1101164be7879e498 Mon Sep 17 00:00:00 2001 From: Kris Austin Date: Thu, 27 Aug 2026 06:06:50 -0500 Subject: [PATCH 3/5] build: clear 295 more -Woverloaded-virtual warnings in GUI widgets (#15394) build: clear 295 -Woverloaded-virtual warnings in GUI widgets Turns three hidden base virtuals into real overrides, clearing 295 of the 553 -Woverloaded-virtual warnings and taking a full clang-cl build from 1,264 to 969. Part of #15374. Search.hpp: SearchDialog::Popup and SearchObjectDialog::Popup took a wxPoint that neither body ever read, hiding the virtual wxPopupTransientWindow::Popup(wxWindow*). Both bodies clear the input, call the base, set focus and refill the list, and SearchObjectDialog also guards re-entry, so hiding meant none of that ran when the window was popped through a base pointer. They now override and forward focus. LabeledStaticBox::SetFont and ScrolledWindow::SetBackgroundColour hid their base virtuals the same way, so the label metrics recompute and the child colour propagation only ran for callers holding the concrete type. Both now override. Marking a member override makes clang flag every other unmarked override in the same class, so seven sibling declarations needed the keyword too. Left unmarked they were worth 481 warnings, which would have made this a net loss. MSWDismissUnfocusedPopup is declared only inside #ifdef __WXMSW__ in wx/popupwin.h, so off Windows there is no base virtual to override and the keyword would not compile. Both the declarations and the definitions are guarded, which is how wxWidgets itself declares MSWWindowProc in wx/nativewin.h and how this repo already handles it in BBLTopbar, MainFrame, Button, ComboBox and TabCtrl. ScrolledWindow's constructor left m_userPanel and m_scroll_win uninitialised unless the style requested a vertical scrollbar, while SetBackgroundColour dereferences both. No caller hits that today since every instantiation passes wxVSCROLL, but the override widens who can reach them, so they are now initialised alongside their siblings. Co-authored-by: Rodrigo Faselli <162915171+RF47@users.noreply.github.com> --- src/slic3r/GUI/Search.cpp | 12 ++++++++---- src/slic3r/GUI/Search.hpp | 20 ++++++++++++-------- src/slic3r/GUI/Widgets/LabeledStaticBox.cpp | 3 ++- src/slic3r/GUI/Widgets/LabeledStaticBox.hpp | 2 +- src/slic3r/GUI/Widgets/ScrolledWindow.cpp | 7 +++++-- src/slic3r/GUI/Widgets/ScrolledWindow.hpp | 4 ++-- 6 files changed, 30 insertions(+), 18 deletions(-) diff --git a/src/slic3r/GUI/Search.cpp b/src/slic3r/GUI/Search.cpp index 1d5cf0b9e5..f8fc51ed02 100644 --- a/src/slic3r/GUI/Search.cpp +++ b/src/slic3r/GUI/Search.cpp @@ -681,7 +681,7 @@ SearchDialog::SearchDialog(OptionsSearcher *searcher, Preset::Type type, wxWindo SearchDialog::~SearchDialog() {} -void SearchDialog::Popup(wxPoint position /*= wxDefaultPosition*/) +void SearchDialog::Popup(wxWindow *focus /*= nullptr*/) { /* const std::string& line = searcher->search_string(); search_line->SetValue(line.empty() ? default_string : from_u8(line)); @@ -696,17 +696,19 @@ void SearchDialog::Popup(wxPoint position /*= wxDefaultPosition*/) search_line2->SetValue(wxString("")); //const std::string &line = searcher->search_string(); //searcher->search(into_u8(line), true); - PopupWindow::Popup(); + PopupWindow::Popup(focus); search_line2->SetFocus(); update_list(); } +#ifdef __WXMSW__ void SearchDialog::MSWDismissUnfocusedPopup() { Dismiss(); OnDismiss(); } +#endif // __WXMSW__ void SearchDialog::OnDismiss() { } @@ -926,7 +928,7 @@ SearchObjectDialog::SearchObjectDialog(GUI::ObjectList* object_list, wxWindow* p SearchObjectDialog::~SearchObjectDialog() {} -void SearchObjectDialog::Popup(wxPoint position /*= wxDefaultPosition*/) +void SearchObjectDialog::Popup(wxWindow *focus /*= nullptr*/) { if (m_is_dismissing || this->IsShown()) { return; @@ -937,7 +939,7 @@ void SearchObjectDialog::Popup(wxPoint position /*= wxDefaultPosition*/) // dropdown list, otherwise the text input won't be usable m_object_list->SetFocus(); #endif - PopupWindow::Popup(); + PopupWindow::Popup(focus); search_line2->SetFocus(); m_object_list->assembly_plate_object_name(); @@ -945,11 +947,13 @@ void SearchObjectDialog::Popup(wxPoint position /*= wxDefaultPosition*/) update_list(); } +#ifdef __WXMSW__ void SearchObjectDialog::MSWDismissUnfocusedPopup() { Dismiss(); OnDismiss(); } +#endif // __WXMSW__ void SearchObjectDialog::OnDismiss() {} diff --git a/src/slic3r/GUI/Search.hpp b/src/slic3r/GUI/Search.hpp index bdb4da83c4..4ae43dbca0 100644 --- a/src/slic3r/GUI/Search.hpp +++ b/src/slic3r/GUI/Search.hpp @@ -216,10 +216,12 @@ public: SearchDialog(OptionsSearcher *searcher, Preset::Type type, wxWindow *parent, TextInput *input, wxWindow *search_btn); ~SearchDialog(); - void MSWDismissUnfocusedPopup(); - void Popup(wxPoint position = wxDefaultPosition); - void OnDismiss(); - void Dismiss(); +#ifdef __WXMSW__ + void MSWDismissUnfocusedPopup() override; +#endif // __WXMSW__ + void Popup(wxWindow *focus = nullptr) override; + void OnDismiss() override; + void Dismiss() override; void Die(); void msw_rescale(); @@ -260,10 +262,12 @@ public: SearchObjectDialog(GUI::ObjectList* object_list, wxWindow* parent, TextInput* input); ~SearchObjectDialog(); - void MSWDismissUnfocusedPopup(); - void Popup(wxPoint position = wxDefaultPosition); - void OnDismiss(); - void Dismiss(); +#ifdef __WXMSW__ + void MSWDismissUnfocusedPopup() override; +#endif // __WXMSW__ + void Popup(wxWindow *focus = nullptr) override; + void OnDismiss() override; + void Dismiss() override; void Die(); void OnInputText(wxCommandEvent& event); diff --git a/src/slic3r/GUI/Widgets/LabeledStaticBox.cpp b/src/slic3r/GUI/Widgets/LabeledStaticBox.cpp index c8e054593f..a11839a8b8 100644 --- a/src/slic3r/GUI/Widgets/LabeledStaticBox.cpp +++ b/src/slic3r/GUI/Widgets/LabeledStaticBox.cpp @@ -98,7 +98,7 @@ void LabeledStaticBox::SetBorderColor(StateColor const &color) Refresh(); } -void LabeledStaticBox::SetFont(wxFont set_font) +bool LabeledStaticBox::SetFont(const wxFont &set_font) { m_font = set_font; @@ -109,6 +109,7 @@ void LabeledStaticBox::SetFont(wxFont set_font) m_label_width = tW; Refresh(); + return true; } bool LabeledStaticBox::Enable(bool enable) diff --git a/src/slic3r/GUI/Widgets/LabeledStaticBox.hpp b/src/slic3r/GUI/Widgets/LabeledStaticBox.hpp index f42175ae05..d3e7f2efce 100644 --- a/src/slic3r/GUI/Widgets/LabeledStaticBox.hpp +++ b/src/slic3r/GUI/Widgets/LabeledStaticBox.hpp @@ -42,7 +42,7 @@ public: void SetBorderColor(StateColor const &color); - void SetFont(wxFont set_font); + bool SetFont(const wxFont &set_font) override; bool Enable(bool enable) override; diff --git a/src/slic3r/GUI/Widgets/ScrolledWindow.cpp b/src/slic3r/GUI/Widgets/ScrolledWindow.cpp index 6aa6f5b600..90922f93f1 100644 --- a/src/slic3r/GUI/Widgets/ScrolledWindow.cpp +++ b/src/slic3r/GUI/Widgets/ScrolledWindow.cpp @@ -21,6 +21,8 @@ ScrolledWindow::ScrolledWindow(wxWindow *parent, wxWindowID id, wxPoint position m_bottomScrollbar = NULL; m_verticalSplitter = NULL; m_horizontalSplitter = NULL; + m_userPanel = NULL; + m_scroll_win = NULL; m_marginWidth = marginWidth; @@ -110,12 +112,13 @@ void ScrolledWindow::SetTipColor(wxColour color) if (m_bottomScrollbar) m_bottomScrollbar->SetTipColor(color); } -void ScrolledWindow::SetBackgroundColour(wxColour color) +bool ScrolledWindow::SetBackgroundColour(const wxColour &color) { - wxWindow::SetBackgroundColour(color); + const bool result = wxWindow::SetBackgroundColour(color); m_verticalSplitter->SetBackgroundColour(color); m_userPanel->SetBackgroundColour(color); m_scroll_win->SetBackgroundColour(color); + return result; } void ScrolledWindow::SetMarginColor(wxColour color) diff --git a/src/slic3r/GUI/Widgets/ScrolledWindow.hpp b/src/slic3r/GUI/Widgets/ScrolledWindow.hpp index 38409a19d4..5c2bc2f9e5 100644 --- a/src/slic3r/GUI/Widgets/ScrolledWindow.hpp +++ b/src/slic3r/GUI/Widgets/ScrolledWindow.hpp @@ -15,7 +15,7 @@ public: ScrolledWindow(wxWindow *parent, wxWindowID id, wxPoint position, wxSize size, long style, int marginWidth = 0, int scrollbarWidth = 4, int tipLength = 0); void OnMouseWheel(wxMouseEvent &event); void SetTipColor(wxColour color); - void SetBackgroundColour(wxColour color); + bool SetBackgroundColour(const wxColour &color) override; void SetMarginColor(wxColour color); void SetScrollbarColor(wxColour color); @@ -26,7 +26,7 @@ public: // wxSplitterWindow* GetVerticalSplitter() { return m_verticalSplitter; } // wxSplitterWindow* GetHorizontalSplitter() { return m_horizontalSplitter; } bool IsBothDirections() { return m_bothDirections; } - virtual void SetScrollbars(int pixelsPerUnitX, int pixelsPerUnitY, int noUnitsX, int noUnitsY, int xPos = 0, int yPos = 0, bool noRefresh = false); + virtual void SetScrollbars(int pixelsPerUnitX, int pixelsPerUnitY, int noUnitsX, int noUnitsY, int xPos = 0, int yPos = 0, bool noRefresh = false) override; private: wxPanel * m_userPanel; // the panel targeted by the scrolled window From 6fdd4945c19348cc5fc9ed9ae2f26f22a778786b Mon Sep 17 00:00:00 2001 From: schneider007 Date: Thu, 27 Aug 2026 19:16:34 +0800 Subject: [PATCH 4/5] Fix bug: centroid calculation (#15399) --- src/libslic3r/AABBTreeIndirect.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libslic3r/AABBTreeIndirect.hpp b/src/libslic3r/AABBTreeIndirect.hpp index 035982d876..483ca8efc4 100644 --- a/src/libslic3r/AABBTreeIndirect.hpp +++ b/src/libslic3r/AABBTreeIndirect.hpp @@ -229,7 +229,7 @@ public: m_bbox(bbox.min - Point(SCALED_EPSILON, SCALED_EPSILON), bbox.max + Point(SCALED_EPSILON, SCALED_EPSILON)) {} size_t idx() const { return m_idx; } const BoundingBox& bbox() const { return m_bbox; } - Point centroid() const { return (m_bbox.min() + m_bbox.max() / 2); } + Point centroid() const { return (m_bbox.min() + m_bbox.max()) / 2; } private: size_t m_idx; BoundingBox m_bbox; From 6d1584844e873169580b2aaf946bc9ceae0547d8 Mon Sep 17 00:00:00 2001 From: Kris Austin Date: Thu, 27 Aug 2026 17:06:06 -0500 Subject: [PATCH 5/5] fix: STEP part names with accented characters import as numbers (clears 6 warnings) (#15406) --- src/libslic3r/Format/OBJ.cpp | 4 +- src/libslic3r/Format/STEP.cpp | 32 +- tests/data/utf8_part_names.step | 1207 +++++++++++++++++++++++++++++++ tests/libslic3r/CMakeLists.txt | 1 + tests/libslic3r/test_step.cpp | 93 +++ tests/test_utils.hpp | 21 +- 6 files changed, 1344 insertions(+), 14 deletions(-) create mode 100644 tests/data/utf8_part_names.step create mode 100644 tests/libslic3r/test_step.cpp diff --git a/src/libslic3r/Format/OBJ.cpp b/src/libslic3r/Format/OBJ.cpp index 50826924f4..e066925a98 100644 --- a/src/libslic3r/Format/OBJ.cpp +++ b/src/libslic3r/Format/OBJ.cpp @@ -55,9 +55,9 @@ bool load_obj(const char *path, TriangleMesh *meshptr, ObjInfo& obj_info, std::s boost::filesystem::path temp_mtl_path(mtl_file); mtl_path = temp_mtl_path; } - auto _mtl_path = mtl_name_is_path ? mtl_abs_path.string().c_str() : mtl_path.string().c_str(); + const std::string _mtl_path = (mtl_name_is_path ? mtl_abs_path : mtl_path).string(); if (boost::filesystem::exists(mtl_name_is_path ? mtl_abs_path : mtl_path)) { - if (!ObjParser::mtlparse(_mtl_path, mtl_data)) { + if (!ObjParser::mtlparse(_mtl_path.c_str(), mtl_data)) { BOOST_LOG_TRIVIAL(error) << "load_obj:load_mtl: failed to parse " << _mtl_path; message = _L("load mtl in obj: failed to parse"); return false; diff --git a/src/libslic3r/Format/STEP.cpp b/src/libslic3r/Format/STEP.cpp index a5c3bb49a2..9cfd3b5cc8 100644 --- a/src/libslic3r/Format/STEP.cpp +++ b/src/libslic3r/Format/STEP.cpp @@ -111,14 +111,19 @@ bool StepPreProcessor::isUtf8File(const char* path) bool StepPreProcessor::isUtf8(const std::string str) { size_t num = 0; - int i = 0; + size_t i = 0; while (i < str.length()) { - if ((str[i] & 0x80) == 0x00) { + const unsigned char lead = static_cast(str[i]); + if ((lead & 0x80) == 0x00) { i++; - } else if ((num = preNum(str[i])) > 2) { + // preNum() counts the leading 1 bits, and a multi-byte sequence is 2 to 4 + // bytes long, so anything outside that range is not a lead byte. + } else if ((num = preNum(lead)) >= 2 && num <= 4) { + if (i + num > str.length()) + return false; i++; - for (int j = 0; j < num - 1; j++) { - if ((str[i] & 0xc0) != 0x80) + for (size_t j = 0; j < num - 1; j++) { + if ((static_cast(str[i]) & 0xc0) != 0x80) return false; i++; } @@ -132,15 +137,20 @@ bool StepPreProcessor::isUtf8(const std::string str) bool StepPreProcessor::isGBK(const std::string str) { size_t i = 0; while (i < str.length()) { - if (str[i] <= 0x7f) { + // char is signed here, so every byte compares <= 0x7f unless widened first. + const unsigned char lead = static_cast(str[i]); + if (lead <= 0x7f) { i++; continue; } else { - if (str[i] >= 0x81 && - str[i] <= 0xfe && - str[i + 1] >= 0x40 && - str[i + 1] <= 0xfe && - str[i + 1] != 0xf7) { + if (i + 1 >= str.length()) + return false; + const unsigned char trail = static_cast(str[i + 1]); + if (lead >= 0x81 && + lead <= 0xfe && + trail >= 0x40 && + trail <= 0xfe && + trail != 0xf7) { i += 2; continue; } diff --git a/tests/data/utf8_part_names.step b/tests/data/utf8_part_names.step new file mode 100644 index 0000000000..c6d41898ad --- /dev/null +++ b/tests/data/utf8_part_names.step @@ -0,0 +1,1207 @@ +ISO-10303-21; +HEADER; +FILE_DESCRIPTION(('Open CASCADE Model'),'2;1'); +FILE_NAME('Open CASCADE Shape Model','2026-08-27T11:50:16',('Author'),( + 'Open CASCADE'),'Open CASCADE STEP processor 7.6','Open CASCADE 7.6' + ,'Unknown'); +FILE_SCHEMA(('AUTOMOTIVE_DESIGN { 1 0 10303 214 1 1 1 1 }')); +ENDSEC; +DATA; +#1 = APPLICATION_PROTOCOL_DEFINITION('international standard', + 'automotive_design',2000,#2); +#2 = APPLICATION_CONTEXT( + 'core data for automotive mechanical design processes'); +#3 = SHAPE_DEFINITION_REPRESENTATION(#4,#10); +#4 = PRODUCT_DEFINITION_SHAPE('','',#5); +#5 = PRODUCT_DEFINITION('design','',#6,#9); +#6 = PRODUCT_DEFINITION_FORMATION('','',#7); +#7 = PRODUCT('pièce','pièce','',(#8)); +#8 = PRODUCT_CONTEXT('',#2,'mechanical'); +#9 = PRODUCT_DEFINITION_CONTEXT('part definition',#2,'design'); +#10 = ADVANCED_BREP_SHAPE_REPRESENTATION('',(#11,#15),#345); +#11 = AXIS2_PLACEMENT_3D('',#12,#13,#14); +#12 = CARTESIAN_POINT('',(0.,0.,0.)); +#13 = DIRECTION('',(0.,0.,1.)); +#14 = DIRECTION('',(1.,0.,-0.)); +#15 = MANIFOLD_SOLID_BREP('',#16); +#16 = CLOSED_SHELL('',(#17,#137,#237,#284,#331,#338)); +#17 = ADVANCED_FACE('',(#18),#32,.F.); +#18 = FACE_BOUND('',#19,.F.); +#19 = EDGE_LOOP('',(#20,#55,#83,#111)); +#20 = ORIENTED_EDGE('',*,*,#21,.F.); +#21 = EDGE_CURVE('',#22,#24,#26,.T.); +#22 = VERTEX_POINT('',#23); +#23 = CARTESIAN_POINT('',(0.,0.,0.)); +#24 = VERTEX_POINT('',#25); +#25 = CARTESIAN_POINT('',(0.,0.,6.)); +#26 = SURFACE_CURVE('',#27,(#31,#43),.PCURVE_S1.); +#27 = LINE('',#28,#29); +#28 = CARTESIAN_POINT('',(0.,0.,0.)); +#29 = VECTOR('',#30,1.); +#30 = DIRECTION('',(0.,0.,1.)); +#31 = PCURVE('',#32,#37); +#32 = PLANE('',#33); +#33 = AXIS2_PLACEMENT_3D('',#34,#35,#36); +#34 = CARTESIAN_POINT('',(0.,0.,0.)); +#35 = DIRECTION('',(1.,0.,-0.)); +#36 = DIRECTION('',(0.,0.,1.)); +#37 = DEFINITIONAL_REPRESENTATION('',(#38),#42); +#38 = LINE('',#39,#40); +#39 = CARTESIAN_POINT('',(0.,0.)); +#40 = VECTOR('',#41,1.); +#41 = DIRECTION('',(1.,0.)); +#42 = ( GEOMETRIC_REPRESENTATION_CONTEXT(2) +PARAMETRIC_REPRESENTATION_CONTEXT() REPRESENTATION_CONTEXT('2D SPACE','' + ) ); +#43 = PCURVE('',#44,#49); +#44 = PLANE('',#45); +#45 = AXIS2_PLACEMENT_3D('',#46,#47,#48); +#46 = CARTESIAN_POINT('',(0.,0.,0.)); +#47 = DIRECTION('',(-0.,1.,0.)); +#48 = DIRECTION('',(0.,0.,1.)); +#49 = DEFINITIONAL_REPRESENTATION('',(#50),#54); +#50 = LINE('',#51,#52); +#51 = CARTESIAN_POINT('',(0.,0.)); +#52 = VECTOR('',#53,1.); +#53 = DIRECTION('',(1.,0.)); +#54 = ( GEOMETRIC_REPRESENTATION_CONTEXT(2) +PARAMETRIC_REPRESENTATION_CONTEXT() REPRESENTATION_CONTEXT('2D SPACE','' + ) ); +#55 = ORIENTED_EDGE('',*,*,#56,.T.); +#56 = EDGE_CURVE('',#22,#57,#59,.T.); +#57 = VERTEX_POINT('',#58); +#58 = CARTESIAN_POINT('',(0.,12.,0.)); +#59 = SURFACE_CURVE('',#60,(#64,#71),.PCURVE_S1.); +#60 = LINE('',#61,#62); +#61 = CARTESIAN_POINT('',(0.,0.,0.)); +#62 = VECTOR('',#63,1.); +#63 = DIRECTION('',(-0.,1.,0.)); +#64 = PCURVE('',#32,#65); +#65 = DEFINITIONAL_REPRESENTATION('',(#66),#70); +#66 = LINE('',#67,#68); +#67 = CARTESIAN_POINT('',(0.,0.)); +#68 = VECTOR('',#69,1.); +#69 = DIRECTION('',(0.,-1.)); +#70 = ( GEOMETRIC_REPRESENTATION_CONTEXT(2) +PARAMETRIC_REPRESENTATION_CONTEXT() REPRESENTATION_CONTEXT('2D SPACE','' + ) ); +#71 = PCURVE('',#72,#77); +#72 = PLANE('',#73); +#73 = AXIS2_PLACEMENT_3D('',#74,#75,#76); +#74 = CARTESIAN_POINT('',(0.,0.,0.)); +#75 = DIRECTION('',(0.,0.,1.)); +#76 = DIRECTION('',(1.,0.,-0.)); +#77 = DEFINITIONAL_REPRESENTATION('',(#78),#82); +#78 = LINE('',#79,#80); +#79 = CARTESIAN_POINT('',(0.,0.)); +#80 = VECTOR('',#81,1.); +#81 = DIRECTION('',(0.,1.)); +#82 = ( GEOMETRIC_REPRESENTATION_CONTEXT(2) +PARAMETRIC_REPRESENTATION_CONTEXT() REPRESENTATION_CONTEXT('2D SPACE','' + ) ); +#83 = ORIENTED_EDGE('',*,*,#84,.T.); +#84 = EDGE_CURVE('',#57,#85,#87,.T.); +#85 = VERTEX_POINT('',#86); +#86 = CARTESIAN_POINT('',(0.,12.,6.)); +#87 = SURFACE_CURVE('',#88,(#92,#99),.PCURVE_S1.); +#88 = LINE('',#89,#90); +#89 = CARTESIAN_POINT('',(0.,12.,0.)); +#90 = VECTOR('',#91,1.); +#91 = DIRECTION('',(0.,0.,1.)); +#92 = PCURVE('',#32,#93); +#93 = DEFINITIONAL_REPRESENTATION('',(#94),#98); +#94 = LINE('',#95,#96); +#95 = CARTESIAN_POINT('',(0.,-12.)); +#96 = VECTOR('',#97,1.); +#97 = DIRECTION('',(1.,0.)); +#98 = ( GEOMETRIC_REPRESENTATION_CONTEXT(2) +PARAMETRIC_REPRESENTATION_CONTEXT() REPRESENTATION_CONTEXT('2D SPACE','' + ) ); +#99 = PCURVE('',#100,#105); +#100 = PLANE('',#101); +#101 = AXIS2_PLACEMENT_3D('',#102,#103,#104); +#102 = CARTESIAN_POINT('',(0.,12.,0.)); +#103 = DIRECTION('',(-0.,1.,0.)); +#104 = DIRECTION('',(0.,0.,1.)); +#105 = DEFINITIONAL_REPRESENTATION('',(#106),#110); +#106 = LINE('',#107,#108); +#107 = CARTESIAN_POINT('',(0.,0.)); +#108 = VECTOR('',#109,1.); +#109 = DIRECTION('',(1.,0.)); +#110 = ( GEOMETRIC_REPRESENTATION_CONTEXT(2) +PARAMETRIC_REPRESENTATION_CONTEXT() REPRESENTATION_CONTEXT('2D SPACE','' + ) ); +#111 = ORIENTED_EDGE('',*,*,#112,.F.); +#112 = EDGE_CURVE('',#24,#85,#113,.T.); +#113 = SURFACE_CURVE('',#114,(#118,#125),.PCURVE_S1.); +#114 = LINE('',#115,#116); +#115 = CARTESIAN_POINT('',(0.,0.,6.)); +#116 = VECTOR('',#117,1.); +#117 = DIRECTION('',(-0.,1.,0.)); +#118 = PCURVE('',#32,#119); +#119 = DEFINITIONAL_REPRESENTATION('',(#120),#124); +#120 = LINE('',#121,#122); +#121 = CARTESIAN_POINT('',(6.,0.)); +#122 = VECTOR('',#123,1.); +#123 = DIRECTION('',(0.,-1.)); +#124 = ( GEOMETRIC_REPRESENTATION_CONTEXT(2) +PARAMETRIC_REPRESENTATION_CONTEXT() REPRESENTATION_CONTEXT('2D SPACE','' + ) ); +#125 = PCURVE('',#126,#131); +#126 = PLANE('',#127); +#127 = AXIS2_PLACEMENT_3D('',#128,#129,#130); +#128 = CARTESIAN_POINT('',(0.,0.,6.)); +#129 = DIRECTION('',(0.,0.,1.)); +#130 = DIRECTION('',(1.,0.,-0.)); +#131 = DEFINITIONAL_REPRESENTATION('',(#132),#136); +#132 = LINE('',#133,#134); +#133 = CARTESIAN_POINT('',(0.,0.)); +#134 = VECTOR('',#135,1.); +#135 = DIRECTION('',(0.,1.)); +#136 = ( GEOMETRIC_REPRESENTATION_CONTEXT(2) +PARAMETRIC_REPRESENTATION_CONTEXT() REPRESENTATION_CONTEXT('2D SPACE','' + ) ); +#137 = ADVANCED_FACE('',(#138),#152,.T.); +#138 = FACE_BOUND('',#139,.T.); +#139 = EDGE_LOOP('',(#140,#170,#193,#216)); +#140 = ORIENTED_EDGE('',*,*,#141,.F.); +#141 = EDGE_CURVE('',#142,#144,#146,.T.); +#142 = VERTEX_POINT('',#143); +#143 = CARTESIAN_POINT('',(20.,0.,0.)); +#144 = VERTEX_POINT('',#145); +#145 = CARTESIAN_POINT('',(20.,0.,6.)); +#146 = SURFACE_CURVE('',#147,(#151,#163),.PCURVE_S1.); +#147 = LINE('',#148,#149); +#148 = CARTESIAN_POINT('',(20.,0.,0.)); +#149 = VECTOR('',#150,1.); +#150 = DIRECTION('',(0.,0.,1.)); +#151 = PCURVE('',#152,#157); +#152 = PLANE('',#153); +#153 = AXIS2_PLACEMENT_3D('',#154,#155,#156); +#154 = CARTESIAN_POINT('',(20.,0.,0.)); +#155 = DIRECTION('',(1.,0.,-0.)); +#156 = DIRECTION('',(0.,0.,1.)); +#157 = DEFINITIONAL_REPRESENTATION('',(#158),#162); +#158 = LINE('',#159,#160); +#159 = CARTESIAN_POINT('',(0.,0.)); +#160 = VECTOR('',#161,1.); +#161 = DIRECTION('',(1.,0.)); +#162 = ( GEOMETRIC_REPRESENTATION_CONTEXT(2) +PARAMETRIC_REPRESENTATION_CONTEXT() REPRESENTATION_CONTEXT('2D SPACE','' + ) ); +#163 = PCURVE('',#44,#164); +#164 = DEFINITIONAL_REPRESENTATION('',(#165),#169); +#165 = LINE('',#166,#167); +#166 = CARTESIAN_POINT('',(0.,20.)); +#167 = VECTOR('',#168,1.); +#168 = DIRECTION('',(1.,0.)); +#169 = ( GEOMETRIC_REPRESENTATION_CONTEXT(2) +PARAMETRIC_REPRESENTATION_CONTEXT() REPRESENTATION_CONTEXT('2D SPACE','' + ) ); +#170 = ORIENTED_EDGE('',*,*,#171,.T.); +#171 = EDGE_CURVE('',#142,#172,#174,.T.); +#172 = VERTEX_POINT('',#173); +#173 = CARTESIAN_POINT('',(20.,12.,0.)); +#174 = SURFACE_CURVE('',#175,(#179,#186),.PCURVE_S1.); +#175 = LINE('',#176,#177); +#176 = CARTESIAN_POINT('',(20.,0.,0.)); +#177 = VECTOR('',#178,1.); +#178 = DIRECTION('',(-0.,1.,0.)); +#179 = PCURVE('',#152,#180); +#180 = DEFINITIONAL_REPRESENTATION('',(#181),#185); +#181 = LINE('',#182,#183); +#182 = CARTESIAN_POINT('',(0.,0.)); +#183 = VECTOR('',#184,1.); +#184 = DIRECTION('',(0.,-1.)); +#185 = ( GEOMETRIC_REPRESENTATION_CONTEXT(2) +PARAMETRIC_REPRESENTATION_CONTEXT() REPRESENTATION_CONTEXT('2D SPACE','' + ) ); +#186 = PCURVE('',#72,#187); +#187 = DEFINITIONAL_REPRESENTATION('',(#188),#192); +#188 = LINE('',#189,#190); +#189 = CARTESIAN_POINT('',(20.,0.)); +#190 = VECTOR('',#191,1.); +#191 = DIRECTION('',(0.,1.)); +#192 = ( GEOMETRIC_REPRESENTATION_CONTEXT(2) +PARAMETRIC_REPRESENTATION_CONTEXT() REPRESENTATION_CONTEXT('2D SPACE','' + ) ); +#193 = ORIENTED_EDGE('',*,*,#194,.T.); +#194 = EDGE_CURVE('',#172,#195,#197,.T.); +#195 = VERTEX_POINT('',#196); +#196 = CARTESIAN_POINT('',(20.,12.,6.)); +#197 = SURFACE_CURVE('',#198,(#202,#209),.PCURVE_S1.); +#198 = LINE('',#199,#200); +#199 = CARTESIAN_POINT('',(20.,12.,0.)); +#200 = VECTOR('',#201,1.); +#201 = DIRECTION('',(0.,0.,1.)); +#202 = PCURVE('',#152,#203); +#203 = DEFINITIONAL_REPRESENTATION('',(#204),#208); +#204 = LINE('',#205,#206); +#205 = CARTESIAN_POINT('',(0.,-12.)); +#206 = VECTOR('',#207,1.); +#207 = DIRECTION('',(1.,0.)); +#208 = ( GEOMETRIC_REPRESENTATION_CONTEXT(2) +PARAMETRIC_REPRESENTATION_CONTEXT() REPRESENTATION_CONTEXT('2D SPACE','' + ) ); +#209 = PCURVE('',#100,#210); +#210 = DEFINITIONAL_REPRESENTATION('',(#211),#215); +#211 = LINE('',#212,#213); +#212 = CARTESIAN_POINT('',(0.,20.)); +#213 = VECTOR('',#214,1.); +#214 = DIRECTION('',(1.,0.)); +#215 = ( GEOMETRIC_REPRESENTATION_CONTEXT(2) +PARAMETRIC_REPRESENTATION_CONTEXT() REPRESENTATION_CONTEXT('2D SPACE','' + ) ); +#216 = ORIENTED_EDGE('',*,*,#217,.F.); +#217 = EDGE_CURVE('',#144,#195,#218,.T.); +#218 = SURFACE_CURVE('',#219,(#223,#230),.PCURVE_S1.); +#219 = LINE('',#220,#221); +#220 = CARTESIAN_POINT('',(20.,0.,6.)); +#221 = VECTOR('',#222,1.); +#222 = DIRECTION('',(-0.,1.,0.)); +#223 = PCURVE('',#152,#224); +#224 = DEFINITIONAL_REPRESENTATION('',(#225),#229); +#225 = LINE('',#226,#227); +#226 = CARTESIAN_POINT('',(6.,0.)); +#227 = VECTOR('',#228,1.); +#228 = DIRECTION('',(0.,-1.)); +#229 = ( GEOMETRIC_REPRESENTATION_CONTEXT(2) +PARAMETRIC_REPRESENTATION_CONTEXT() REPRESENTATION_CONTEXT('2D SPACE','' + ) ); +#230 = PCURVE('',#126,#231); +#231 = DEFINITIONAL_REPRESENTATION('',(#232),#236); +#232 = LINE('',#233,#234); +#233 = CARTESIAN_POINT('',(20.,0.)); +#234 = VECTOR('',#235,1.); +#235 = DIRECTION('',(0.,1.)); +#236 = ( GEOMETRIC_REPRESENTATION_CONTEXT(2) +PARAMETRIC_REPRESENTATION_CONTEXT() REPRESENTATION_CONTEXT('2D SPACE','' + ) ); +#237 = ADVANCED_FACE('',(#238),#44,.F.); +#238 = FACE_BOUND('',#239,.F.); +#239 = EDGE_LOOP('',(#240,#261,#262,#283)); +#240 = ORIENTED_EDGE('',*,*,#241,.F.); +#241 = EDGE_CURVE('',#22,#142,#242,.T.); +#242 = SURFACE_CURVE('',#243,(#247,#254),.PCURVE_S1.); +#243 = LINE('',#244,#245); +#244 = CARTESIAN_POINT('',(0.,0.,0.)); +#245 = VECTOR('',#246,1.); +#246 = DIRECTION('',(1.,0.,-0.)); +#247 = PCURVE('',#44,#248); +#248 = DEFINITIONAL_REPRESENTATION('',(#249),#253); +#249 = LINE('',#250,#251); +#250 = CARTESIAN_POINT('',(0.,0.)); +#251 = VECTOR('',#252,1.); +#252 = DIRECTION('',(0.,1.)); +#253 = ( GEOMETRIC_REPRESENTATION_CONTEXT(2) +PARAMETRIC_REPRESENTATION_CONTEXT() REPRESENTATION_CONTEXT('2D SPACE','' + ) ); +#254 = PCURVE('',#72,#255); +#255 = DEFINITIONAL_REPRESENTATION('',(#256),#260); +#256 = LINE('',#257,#258); +#257 = CARTESIAN_POINT('',(0.,0.)); +#258 = VECTOR('',#259,1.); +#259 = DIRECTION('',(1.,0.)); +#260 = ( GEOMETRIC_REPRESENTATION_CONTEXT(2) +PARAMETRIC_REPRESENTATION_CONTEXT() REPRESENTATION_CONTEXT('2D SPACE','' + ) ); +#261 = ORIENTED_EDGE('',*,*,#21,.T.); +#262 = ORIENTED_EDGE('',*,*,#263,.T.); +#263 = EDGE_CURVE('',#24,#144,#264,.T.); +#264 = SURFACE_CURVE('',#265,(#269,#276),.PCURVE_S1.); +#265 = LINE('',#266,#267); +#266 = CARTESIAN_POINT('',(0.,0.,6.)); +#267 = VECTOR('',#268,1.); +#268 = DIRECTION('',(1.,0.,-0.)); +#269 = PCURVE('',#44,#270); +#270 = DEFINITIONAL_REPRESENTATION('',(#271),#275); +#271 = LINE('',#272,#273); +#272 = CARTESIAN_POINT('',(6.,0.)); +#273 = VECTOR('',#274,1.); +#274 = DIRECTION('',(0.,1.)); +#275 = ( GEOMETRIC_REPRESENTATION_CONTEXT(2) +PARAMETRIC_REPRESENTATION_CONTEXT() REPRESENTATION_CONTEXT('2D SPACE','' + ) ); +#276 = PCURVE('',#126,#277); +#277 = DEFINITIONAL_REPRESENTATION('',(#278),#282); +#278 = LINE('',#279,#280); +#279 = CARTESIAN_POINT('',(0.,0.)); +#280 = VECTOR('',#281,1.); +#281 = DIRECTION('',(1.,0.)); +#282 = ( GEOMETRIC_REPRESENTATION_CONTEXT(2) +PARAMETRIC_REPRESENTATION_CONTEXT() REPRESENTATION_CONTEXT('2D SPACE','' + ) ); +#283 = ORIENTED_EDGE('',*,*,#141,.F.); +#284 = ADVANCED_FACE('',(#285),#100,.T.); +#285 = FACE_BOUND('',#286,.T.); +#286 = EDGE_LOOP('',(#287,#308,#309,#330)); +#287 = ORIENTED_EDGE('',*,*,#288,.F.); +#288 = EDGE_CURVE('',#57,#172,#289,.T.); +#289 = SURFACE_CURVE('',#290,(#294,#301),.PCURVE_S1.); +#290 = LINE('',#291,#292); +#291 = CARTESIAN_POINT('',(0.,12.,0.)); +#292 = VECTOR('',#293,1.); +#293 = DIRECTION('',(1.,0.,-0.)); +#294 = PCURVE('',#100,#295); +#295 = DEFINITIONAL_REPRESENTATION('',(#296),#300); +#296 = LINE('',#297,#298); +#297 = CARTESIAN_POINT('',(0.,0.)); +#298 = VECTOR('',#299,1.); +#299 = DIRECTION('',(0.,1.)); +#300 = ( GEOMETRIC_REPRESENTATION_CONTEXT(2) +PARAMETRIC_REPRESENTATION_CONTEXT() REPRESENTATION_CONTEXT('2D SPACE','' + ) ); +#301 = PCURVE('',#72,#302); +#302 = DEFINITIONAL_REPRESENTATION('',(#303),#307); +#303 = LINE('',#304,#305); +#304 = CARTESIAN_POINT('',(0.,12.)); +#305 = VECTOR('',#306,1.); +#306 = DIRECTION('',(1.,0.)); +#307 = ( GEOMETRIC_REPRESENTATION_CONTEXT(2) +PARAMETRIC_REPRESENTATION_CONTEXT() REPRESENTATION_CONTEXT('2D SPACE','' + ) ); +#308 = ORIENTED_EDGE('',*,*,#84,.T.); +#309 = ORIENTED_EDGE('',*,*,#310,.T.); +#310 = EDGE_CURVE('',#85,#195,#311,.T.); +#311 = SURFACE_CURVE('',#312,(#316,#323),.PCURVE_S1.); +#312 = LINE('',#313,#314); +#313 = CARTESIAN_POINT('',(0.,12.,6.)); +#314 = VECTOR('',#315,1.); +#315 = DIRECTION('',(1.,0.,-0.)); +#316 = PCURVE('',#100,#317); +#317 = DEFINITIONAL_REPRESENTATION('',(#318),#322); +#318 = LINE('',#319,#320); +#319 = CARTESIAN_POINT('',(6.,0.)); +#320 = VECTOR('',#321,1.); +#321 = DIRECTION('',(0.,1.)); +#322 = ( GEOMETRIC_REPRESENTATION_CONTEXT(2) +PARAMETRIC_REPRESENTATION_CONTEXT() REPRESENTATION_CONTEXT('2D SPACE','' + ) ); +#323 = PCURVE('',#126,#324); +#324 = DEFINITIONAL_REPRESENTATION('',(#325),#329); +#325 = LINE('',#326,#327); +#326 = CARTESIAN_POINT('',(0.,12.)); +#327 = VECTOR('',#328,1.); +#328 = DIRECTION('',(1.,0.)); +#329 = ( GEOMETRIC_REPRESENTATION_CONTEXT(2) +PARAMETRIC_REPRESENTATION_CONTEXT() REPRESENTATION_CONTEXT('2D SPACE','' + ) ); +#330 = ORIENTED_EDGE('',*,*,#194,.F.); +#331 = ADVANCED_FACE('',(#332),#72,.F.); +#332 = FACE_BOUND('',#333,.F.); +#333 = EDGE_LOOP('',(#334,#335,#336,#337)); +#334 = ORIENTED_EDGE('',*,*,#56,.F.); +#335 = ORIENTED_EDGE('',*,*,#241,.T.); +#336 = ORIENTED_EDGE('',*,*,#171,.T.); +#337 = ORIENTED_EDGE('',*,*,#288,.F.); +#338 = ADVANCED_FACE('',(#339),#126,.T.); +#339 = FACE_BOUND('',#340,.T.); +#340 = EDGE_LOOP('',(#341,#342,#343,#344)); +#341 = ORIENTED_EDGE('',*,*,#112,.F.); +#342 = ORIENTED_EDGE('',*,*,#263,.T.); +#343 = ORIENTED_EDGE('',*,*,#217,.T.); +#344 = ORIENTED_EDGE('',*,*,#310,.F.); +#345 = ( GEOMETRIC_REPRESENTATION_CONTEXT(3) +GLOBAL_UNCERTAINTY_ASSIGNED_CONTEXT((#349)) GLOBAL_UNIT_ASSIGNED_CONTEXT +((#346,#347,#348)) REPRESENTATION_CONTEXT('Context #1', + '3D Context with UNIT and UNCERTAINTY') ); +#346 = ( LENGTH_UNIT() NAMED_UNIT(*) SI_UNIT(.MILLI.,.METRE.) ); +#347 = ( NAMED_UNIT(*) PLANE_ANGLE_UNIT() SI_UNIT($,.RADIAN.) ); +#348 = ( NAMED_UNIT(*) SI_UNIT($,.STERADIAN.) SOLID_ANGLE_UNIT() ); +#349 = UNCERTAINTY_MEASURE_WITH_UNIT(LENGTH_MEASURE(1.E-07),#346, + 'distance_accuracy_value','confusion accuracy'); +#350 = PRODUCT_RELATED_PRODUCT_CATEGORY('part',$,(#7)); +#351 = SHAPE_DEFINITION_REPRESENTATION(#352,#358); +#352 = PRODUCT_DEFINITION_SHAPE('','',#353); +#353 = PRODUCT_DEFINITION('design','',#354,#357); +#354 = PRODUCT_DEFINITION_FORMATION('','',#355); +#355 = PRODUCT('Gehäuse','Gehäuse','',(#356)); +#356 = PRODUCT_CONTEXT('',#2,'mechanical'); +#357 = PRODUCT_DEFINITION_CONTEXT('part definition',#2,'design'); +#358 = ADVANCED_BREP_SHAPE_REPRESENTATION('',(#11,#359),#689); +#359 = MANIFOLD_SOLID_BREP('',#360); +#360 = CLOSED_SHELL('',(#361,#481,#581,#628,#675,#682)); +#361 = ADVANCED_FACE('',(#362),#376,.F.); +#362 = FACE_BOUND('',#363,.F.); +#363 = EDGE_LOOP('',(#364,#399,#427,#455)); +#364 = ORIENTED_EDGE('',*,*,#365,.F.); +#365 = EDGE_CURVE('',#366,#368,#370,.T.); +#366 = VERTEX_POINT('',#367); +#367 = CARTESIAN_POINT('',(25.,0.,0.)); +#368 = VERTEX_POINT('',#369); +#369 = CARTESIAN_POINT('',(25.,0.,6.)); +#370 = SURFACE_CURVE('',#371,(#375,#387),.PCURVE_S1.); +#371 = LINE('',#372,#373); +#372 = CARTESIAN_POINT('',(25.,0.,0.)); +#373 = VECTOR('',#374,1.); +#374 = DIRECTION('',(0.,0.,1.)); +#375 = PCURVE('',#376,#381); +#376 = PLANE('',#377); +#377 = AXIS2_PLACEMENT_3D('',#378,#379,#380); +#378 = CARTESIAN_POINT('',(25.,0.,0.)); +#379 = DIRECTION('',(1.,0.,-0.)); +#380 = DIRECTION('',(0.,0.,1.)); +#381 = DEFINITIONAL_REPRESENTATION('',(#382),#386); +#382 = LINE('',#383,#384); +#383 = CARTESIAN_POINT('',(0.,0.)); +#384 = VECTOR('',#385,1.); +#385 = DIRECTION('',(1.,0.)); +#386 = ( GEOMETRIC_REPRESENTATION_CONTEXT(2) +PARAMETRIC_REPRESENTATION_CONTEXT() REPRESENTATION_CONTEXT('2D SPACE','' + ) ); +#387 = PCURVE('',#388,#393); +#388 = PLANE('',#389); +#389 = AXIS2_PLACEMENT_3D('',#390,#391,#392); +#390 = CARTESIAN_POINT('',(25.,0.,0.)); +#391 = DIRECTION('',(-0.,1.,0.)); +#392 = DIRECTION('',(0.,0.,1.)); +#393 = DEFINITIONAL_REPRESENTATION('',(#394),#398); +#394 = LINE('',#395,#396); +#395 = CARTESIAN_POINT('',(0.,0.)); +#396 = VECTOR('',#397,1.); +#397 = DIRECTION('',(1.,0.)); +#398 = ( GEOMETRIC_REPRESENTATION_CONTEXT(2) +PARAMETRIC_REPRESENTATION_CONTEXT() REPRESENTATION_CONTEXT('2D SPACE','' + ) ); +#399 = ORIENTED_EDGE('',*,*,#400,.T.); +#400 = EDGE_CURVE('',#366,#401,#403,.T.); +#401 = VERTEX_POINT('',#402); +#402 = CARTESIAN_POINT('',(25.,12.,0.)); +#403 = SURFACE_CURVE('',#404,(#408,#415),.PCURVE_S1.); +#404 = LINE('',#405,#406); +#405 = CARTESIAN_POINT('',(25.,0.,0.)); +#406 = VECTOR('',#407,1.); +#407 = DIRECTION('',(-0.,1.,0.)); +#408 = PCURVE('',#376,#409); +#409 = DEFINITIONAL_REPRESENTATION('',(#410),#414); +#410 = LINE('',#411,#412); +#411 = CARTESIAN_POINT('',(0.,0.)); +#412 = VECTOR('',#413,1.); +#413 = DIRECTION('',(0.,-1.)); +#414 = ( GEOMETRIC_REPRESENTATION_CONTEXT(2) +PARAMETRIC_REPRESENTATION_CONTEXT() REPRESENTATION_CONTEXT('2D SPACE','' + ) ); +#415 = PCURVE('',#416,#421); +#416 = PLANE('',#417); +#417 = AXIS2_PLACEMENT_3D('',#418,#419,#420); +#418 = CARTESIAN_POINT('',(25.,0.,0.)); +#419 = DIRECTION('',(0.,0.,1.)); +#420 = DIRECTION('',(1.,0.,-0.)); +#421 = DEFINITIONAL_REPRESENTATION('',(#422),#426); +#422 = LINE('',#423,#424); +#423 = CARTESIAN_POINT('',(0.,0.)); +#424 = VECTOR('',#425,1.); +#425 = DIRECTION('',(0.,1.)); +#426 = ( GEOMETRIC_REPRESENTATION_CONTEXT(2) +PARAMETRIC_REPRESENTATION_CONTEXT() REPRESENTATION_CONTEXT('2D SPACE','' + ) ); +#427 = ORIENTED_EDGE('',*,*,#428,.T.); +#428 = EDGE_CURVE('',#401,#429,#431,.T.); +#429 = VERTEX_POINT('',#430); +#430 = CARTESIAN_POINT('',(25.,12.,6.)); +#431 = SURFACE_CURVE('',#432,(#436,#443),.PCURVE_S1.); +#432 = LINE('',#433,#434); +#433 = CARTESIAN_POINT('',(25.,12.,0.)); +#434 = VECTOR('',#435,1.); +#435 = DIRECTION('',(0.,0.,1.)); +#436 = PCURVE('',#376,#437); +#437 = DEFINITIONAL_REPRESENTATION('',(#438),#442); +#438 = LINE('',#439,#440); +#439 = CARTESIAN_POINT('',(0.,-12.)); +#440 = VECTOR('',#441,1.); +#441 = DIRECTION('',(1.,0.)); +#442 = ( GEOMETRIC_REPRESENTATION_CONTEXT(2) +PARAMETRIC_REPRESENTATION_CONTEXT() REPRESENTATION_CONTEXT('2D SPACE','' + ) ); +#443 = PCURVE('',#444,#449); +#444 = PLANE('',#445); +#445 = AXIS2_PLACEMENT_3D('',#446,#447,#448); +#446 = CARTESIAN_POINT('',(25.,12.,0.)); +#447 = DIRECTION('',(-0.,1.,0.)); +#448 = DIRECTION('',(0.,0.,1.)); +#449 = DEFINITIONAL_REPRESENTATION('',(#450),#454); +#450 = LINE('',#451,#452); +#451 = CARTESIAN_POINT('',(0.,0.)); +#452 = VECTOR('',#453,1.); +#453 = DIRECTION('',(1.,0.)); +#454 = ( GEOMETRIC_REPRESENTATION_CONTEXT(2) +PARAMETRIC_REPRESENTATION_CONTEXT() REPRESENTATION_CONTEXT('2D SPACE','' + ) ); +#455 = ORIENTED_EDGE('',*,*,#456,.F.); +#456 = EDGE_CURVE('',#368,#429,#457,.T.); +#457 = SURFACE_CURVE('',#458,(#462,#469),.PCURVE_S1.); +#458 = LINE('',#459,#460); +#459 = CARTESIAN_POINT('',(25.,0.,6.)); +#460 = VECTOR('',#461,1.); +#461 = DIRECTION('',(-0.,1.,0.)); +#462 = PCURVE('',#376,#463); +#463 = DEFINITIONAL_REPRESENTATION('',(#464),#468); +#464 = LINE('',#465,#466); +#465 = CARTESIAN_POINT('',(6.,0.)); +#466 = VECTOR('',#467,1.); +#467 = DIRECTION('',(0.,-1.)); +#468 = ( GEOMETRIC_REPRESENTATION_CONTEXT(2) +PARAMETRIC_REPRESENTATION_CONTEXT() REPRESENTATION_CONTEXT('2D SPACE','' + ) ); +#469 = PCURVE('',#470,#475); +#470 = PLANE('',#471); +#471 = AXIS2_PLACEMENT_3D('',#472,#473,#474); +#472 = CARTESIAN_POINT('',(25.,0.,6.)); +#473 = DIRECTION('',(0.,0.,1.)); +#474 = DIRECTION('',(1.,0.,-0.)); +#475 = DEFINITIONAL_REPRESENTATION('',(#476),#480); +#476 = LINE('',#477,#478); +#477 = CARTESIAN_POINT('',(0.,0.)); +#478 = VECTOR('',#479,1.); +#479 = DIRECTION('',(0.,1.)); +#480 = ( GEOMETRIC_REPRESENTATION_CONTEXT(2) +PARAMETRIC_REPRESENTATION_CONTEXT() REPRESENTATION_CONTEXT('2D SPACE','' + ) ); +#481 = ADVANCED_FACE('',(#482),#496,.T.); +#482 = FACE_BOUND('',#483,.T.); +#483 = EDGE_LOOP('',(#484,#514,#537,#560)); +#484 = ORIENTED_EDGE('',*,*,#485,.F.); +#485 = EDGE_CURVE('',#486,#488,#490,.T.); +#486 = VERTEX_POINT('',#487); +#487 = CARTESIAN_POINT('',(41.,0.,0.)); +#488 = VERTEX_POINT('',#489); +#489 = CARTESIAN_POINT('',(41.,0.,6.)); +#490 = SURFACE_CURVE('',#491,(#495,#507),.PCURVE_S1.); +#491 = LINE('',#492,#493); +#492 = CARTESIAN_POINT('',(41.,0.,0.)); +#493 = VECTOR('',#494,1.); +#494 = DIRECTION('',(0.,0.,1.)); +#495 = PCURVE('',#496,#501); +#496 = PLANE('',#497); +#497 = AXIS2_PLACEMENT_3D('',#498,#499,#500); +#498 = CARTESIAN_POINT('',(41.,0.,0.)); +#499 = DIRECTION('',(1.,0.,-0.)); +#500 = DIRECTION('',(0.,0.,1.)); +#501 = DEFINITIONAL_REPRESENTATION('',(#502),#506); +#502 = LINE('',#503,#504); +#503 = CARTESIAN_POINT('',(0.,0.)); +#504 = VECTOR('',#505,1.); +#505 = DIRECTION('',(1.,0.)); +#506 = ( GEOMETRIC_REPRESENTATION_CONTEXT(2) +PARAMETRIC_REPRESENTATION_CONTEXT() REPRESENTATION_CONTEXT('2D SPACE','' + ) ); +#507 = PCURVE('',#388,#508); +#508 = DEFINITIONAL_REPRESENTATION('',(#509),#513); +#509 = LINE('',#510,#511); +#510 = CARTESIAN_POINT('',(0.,16.)); +#511 = VECTOR('',#512,1.); +#512 = DIRECTION('',(1.,0.)); +#513 = ( GEOMETRIC_REPRESENTATION_CONTEXT(2) +PARAMETRIC_REPRESENTATION_CONTEXT() REPRESENTATION_CONTEXT('2D SPACE','' + ) ); +#514 = ORIENTED_EDGE('',*,*,#515,.T.); +#515 = EDGE_CURVE('',#486,#516,#518,.T.); +#516 = VERTEX_POINT('',#517); +#517 = CARTESIAN_POINT('',(41.,12.,0.)); +#518 = SURFACE_CURVE('',#519,(#523,#530),.PCURVE_S1.); +#519 = LINE('',#520,#521); +#520 = CARTESIAN_POINT('',(41.,0.,0.)); +#521 = VECTOR('',#522,1.); +#522 = DIRECTION('',(-0.,1.,0.)); +#523 = PCURVE('',#496,#524); +#524 = DEFINITIONAL_REPRESENTATION('',(#525),#529); +#525 = LINE('',#526,#527); +#526 = CARTESIAN_POINT('',(0.,0.)); +#527 = VECTOR('',#528,1.); +#528 = DIRECTION('',(0.,-1.)); +#529 = ( GEOMETRIC_REPRESENTATION_CONTEXT(2) +PARAMETRIC_REPRESENTATION_CONTEXT() REPRESENTATION_CONTEXT('2D SPACE','' + ) ); +#530 = PCURVE('',#416,#531); +#531 = DEFINITIONAL_REPRESENTATION('',(#532),#536); +#532 = LINE('',#533,#534); +#533 = CARTESIAN_POINT('',(16.,0.)); +#534 = VECTOR('',#535,1.); +#535 = DIRECTION('',(0.,1.)); +#536 = ( GEOMETRIC_REPRESENTATION_CONTEXT(2) +PARAMETRIC_REPRESENTATION_CONTEXT() REPRESENTATION_CONTEXT('2D SPACE','' + ) ); +#537 = ORIENTED_EDGE('',*,*,#538,.T.); +#538 = EDGE_CURVE('',#516,#539,#541,.T.); +#539 = VERTEX_POINT('',#540); +#540 = CARTESIAN_POINT('',(41.,12.,6.)); +#541 = SURFACE_CURVE('',#542,(#546,#553),.PCURVE_S1.); +#542 = LINE('',#543,#544); +#543 = CARTESIAN_POINT('',(41.,12.,0.)); +#544 = VECTOR('',#545,1.); +#545 = DIRECTION('',(0.,0.,1.)); +#546 = PCURVE('',#496,#547); +#547 = DEFINITIONAL_REPRESENTATION('',(#548),#552); +#548 = LINE('',#549,#550); +#549 = CARTESIAN_POINT('',(0.,-12.)); +#550 = VECTOR('',#551,1.); +#551 = DIRECTION('',(1.,0.)); +#552 = ( GEOMETRIC_REPRESENTATION_CONTEXT(2) +PARAMETRIC_REPRESENTATION_CONTEXT() REPRESENTATION_CONTEXT('2D SPACE','' + ) ); +#553 = PCURVE('',#444,#554); +#554 = DEFINITIONAL_REPRESENTATION('',(#555),#559); +#555 = LINE('',#556,#557); +#556 = CARTESIAN_POINT('',(0.,16.)); +#557 = VECTOR('',#558,1.); +#558 = DIRECTION('',(1.,0.)); +#559 = ( GEOMETRIC_REPRESENTATION_CONTEXT(2) +PARAMETRIC_REPRESENTATION_CONTEXT() REPRESENTATION_CONTEXT('2D SPACE','' + ) ); +#560 = ORIENTED_EDGE('',*,*,#561,.F.); +#561 = EDGE_CURVE('',#488,#539,#562,.T.); +#562 = SURFACE_CURVE('',#563,(#567,#574),.PCURVE_S1.); +#563 = LINE('',#564,#565); +#564 = CARTESIAN_POINT('',(41.,0.,6.)); +#565 = VECTOR('',#566,1.); +#566 = DIRECTION('',(-0.,1.,0.)); +#567 = PCURVE('',#496,#568); +#568 = DEFINITIONAL_REPRESENTATION('',(#569),#573); +#569 = LINE('',#570,#571); +#570 = CARTESIAN_POINT('',(6.,0.)); +#571 = VECTOR('',#572,1.); +#572 = DIRECTION('',(0.,-1.)); +#573 = ( GEOMETRIC_REPRESENTATION_CONTEXT(2) +PARAMETRIC_REPRESENTATION_CONTEXT() REPRESENTATION_CONTEXT('2D SPACE','' + ) ); +#574 = PCURVE('',#470,#575); +#575 = DEFINITIONAL_REPRESENTATION('',(#576),#580); +#576 = LINE('',#577,#578); +#577 = CARTESIAN_POINT('',(16.,0.)); +#578 = VECTOR('',#579,1.); +#579 = DIRECTION('',(0.,1.)); +#580 = ( GEOMETRIC_REPRESENTATION_CONTEXT(2) +PARAMETRIC_REPRESENTATION_CONTEXT() REPRESENTATION_CONTEXT('2D SPACE','' + ) ); +#581 = ADVANCED_FACE('',(#582),#388,.F.); +#582 = FACE_BOUND('',#583,.F.); +#583 = EDGE_LOOP('',(#584,#605,#606,#627)); +#584 = ORIENTED_EDGE('',*,*,#585,.F.); +#585 = EDGE_CURVE('',#366,#486,#586,.T.); +#586 = SURFACE_CURVE('',#587,(#591,#598),.PCURVE_S1.); +#587 = LINE('',#588,#589); +#588 = CARTESIAN_POINT('',(25.,0.,0.)); +#589 = VECTOR('',#590,1.); +#590 = DIRECTION('',(1.,0.,-0.)); +#591 = PCURVE('',#388,#592); +#592 = DEFINITIONAL_REPRESENTATION('',(#593),#597); +#593 = LINE('',#594,#595); +#594 = CARTESIAN_POINT('',(0.,0.)); +#595 = VECTOR('',#596,1.); +#596 = DIRECTION('',(0.,1.)); +#597 = ( GEOMETRIC_REPRESENTATION_CONTEXT(2) +PARAMETRIC_REPRESENTATION_CONTEXT() REPRESENTATION_CONTEXT('2D SPACE','' + ) ); +#598 = PCURVE('',#416,#599); +#599 = DEFINITIONAL_REPRESENTATION('',(#600),#604); +#600 = LINE('',#601,#602); +#601 = CARTESIAN_POINT('',(0.,0.)); +#602 = VECTOR('',#603,1.); +#603 = DIRECTION('',(1.,0.)); +#604 = ( GEOMETRIC_REPRESENTATION_CONTEXT(2) +PARAMETRIC_REPRESENTATION_CONTEXT() REPRESENTATION_CONTEXT('2D SPACE','' + ) ); +#605 = ORIENTED_EDGE('',*,*,#365,.T.); +#606 = ORIENTED_EDGE('',*,*,#607,.T.); +#607 = EDGE_CURVE('',#368,#488,#608,.T.); +#608 = SURFACE_CURVE('',#609,(#613,#620),.PCURVE_S1.); +#609 = LINE('',#610,#611); +#610 = CARTESIAN_POINT('',(25.,0.,6.)); +#611 = VECTOR('',#612,1.); +#612 = DIRECTION('',(1.,0.,-0.)); +#613 = PCURVE('',#388,#614); +#614 = DEFINITIONAL_REPRESENTATION('',(#615),#619); +#615 = LINE('',#616,#617); +#616 = CARTESIAN_POINT('',(6.,0.)); +#617 = VECTOR('',#618,1.); +#618 = DIRECTION('',(0.,1.)); +#619 = ( GEOMETRIC_REPRESENTATION_CONTEXT(2) +PARAMETRIC_REPRESENTATION_CONTEXT() REPRESENTATION_CONTEXT('2D SPACE','' + ) ); +#620 = PCURVE('',#470,#621); +#621 = DEFINITIONAL_REPRESENTATION('',(#622),#626); +#622 = LINE('',#623,#624); +#623 = CARTESIAN_POINT('',(0.,0.)); +#624 = VECTOR('',#625,1.); +#625 = DIRECTION('',(1.,0.)); +#626 = ( GEOMETRIC_REPRESENTATION_CONTEXT(2) +PARAMETRIC_REPRESENTATION_CONTEXT() REPRESENTATION_CONTEXT('2D SPACE','' + ) ); +#627 = ORIENTED_EDGE('',*,*,#485,.F.); +#628 = ADVANCED_FACE('',(#629),#444,.T.); +#629 = FACE_BOUND('',#630,.T.); +#630 = EDGE_LOOP('',(#631,#652,#653,#674)); +#631 = ORIENTED_EDGE('',*,*,#632,.F.); +#632 = EDGE_CURVE('',#401,#516,#633,.T.); +#633 = SURFACE_CURVE('',#634,(#638,#645),.PCURVE_S1.); +#634 = LINE('',#635,#636); +#635 = CARTESIAN_POINT('',(25.,12.,0.)); +#636 = VECTOR('',#637,1.); +#637 = DIRECTION('',(1.,0.,-0.)); +#638 = PCURVE('',#444,#639); +#639 = DEFINITIONAL_REPRESENTATION('',(#640),#644); +#640 = LINE('',#641,#642); +#641 = CARTESIAN_POINT('',(0.,0.)); +#642 = VECTOR('',#643,1.); +#643 = DIRECTION('',(0.,1.)); +#644 = ( GEOMETRIC_REPRESENTATION_CONTEXT(2) +PARAMETRIC_REPRESENTATION_CONTEXT() REPRESENTATION_CONTEXT('2D SPACE','' + ) ); +#645 = PCURVE('',#416,#646); +#646 = DEFINITIONAL_REPRESENTATION('',(#647),#651); +#647 = LINE('',#648,#649); +#648 = CARTESIAN_POINT('',(0.,12.)); +#649 = VECTOR('',#650,1.); +#650 = DIRECTION('',(1.,0.)); +#651 = ( GEOMETRIC_REPRESENTATION_CONTEXT(2) +PARAMETRIC_REPRESENTATION_CONTEXT() REPRESENTATION_CONTEXT('2D SPACE','' + ) ); +#652 = ORIENTED_EDGE('',*,*,#428,.T.); +#653 = ORIENTED_EDGE('',*,*,#654,.T.); +#654 = EDGE_CURVE('',#429,#539,#655,.T.); +#655 = SURFACE_CURVE('',#656,(#660,#667),.PCURVE_S1.); +#656 = LINE('',#657,#658); +#657 = CARTESIAN_POINT('',(25.,12.,6.)); +#658 = VECTOR('',#659,1.); +#659 = DIRECTION('',(1.,0.,-0.)); +#660 = PCURVE('',#444,#661); +#661 = DEFINITIONAL_REPRESENTATION('',(#662),#666); +#662 = LINE('',#663,#664); +#663 = CARTESIAN_POINT('',(6.,0.)); +#664 = VECTOR('',#665,1.); +#665 = DIRECTION('',(0.,1.)); +#666 = ( GEOMETRIC_REPRESENTATION_CONTEXT(2) +PARAMETRIC_REPRESENTATION_CONTEXT() REPRESENTATION_CONTEXT('2D SPACE','' + ) ); +#667 = PCURVE('',#470,#668); +#668 = DEFINITIONAL_REPRESENTATION('',(#669),#673); +#669 = LINE('',#670,#671); +#670 = CARTESIAN_POINT('',(0.,12.)); +#671 = VECTOR('',#672,1.); +#672 = DIRECTION('',(1.,0.)); +#673 = ( GEOMETRIC_REPRESENTATION_CONTEXT(2) +PARAMETRIC_REPRESENTATION_CONTEXT() REPRESENTATION_CONTEXT('2D SPACE','' + ) ); +#674 = ORIENTED_EDGE('',*,*,#538,.F.); +#675 = ADVANCED_FACE('',(#676),#416,.F.); +#676 = FACE_BOUND('',#677,.F.); +#677 = EDGE_LOOP('',(#678,#679,#680,#681)); +#678 = ORIENTED_EDGE('',*,*,#400,.F.); +#679 = ORIENTED_EDGE('',*,*,#585,.T.); +#680 = ORIENTED_EDGE('',*,*,#515,.T.); +#681 = ORIENTED_EDGE('',*,*,#632,.F.); +#682 = ADVANCED_FACE('',(#683),#470,.T.); +#683 = FACE_BOUND('',#684,.T.); +#684 = EDGE_LOOP('',(#685,#686,#687,#688)); +#685 = ORIENTED_EDGE('',*,*,#456,.F.); +#686 = ORIENTED_EDGE('',*,*,#607,.T.); +#687 = ORIENTED_EDGE('',*,*,#561,.T.); +#688 = ORIENTED_EDGE('',*,*,#654,.F.); +#689 = ( GEOMETRIC_REPRESENTATION_CONTEXT(3) +GLOBAL_UNCERTAINTY_ASSIGNED_CONTEXT((#693)) GLOBAL_UNIT_ASSIGNED_CONTEXT +((#690,#691,#692)) REPRESENTATION_CONTEXT('Context #1', + '3D Context with UNIT and UNCERTAINTY') ); +#690 = ( LENGTH_UNIT() NAMED_UNIT(*) SI_UNIT(.MILLI.,.METRE.) ); +#691 = ( NAMED_UNIT(*) PLANE_ANGLE_UNIT() SI_UNIT($,.RADIAN.) ); +#692 = ( NAMED_UNIT(*) SI_UNIT($,.STERADIAN.) SOLID_ANGLE_UNIT() ); +#693 = UNCERTAINTY_MEASURE_WITH_UNIT(LENGTH_MEASURE(1.E-07),#690, + 'distance_accuracy_value','confusion accuracy'); +#694 = PRODUCT_RELATED_PRODUCT_CATEGORY('part',$,(#355)); +#695 = SHAPE_DEFINITION_REPRESENTATION(#696,#702); +#696 = PRODUCT_DEFINITION_SHAPE('','',#697); +#697 = PRODUCT_DEFINITION('design','',#698,#701); +#698 = PRODUCT_DEFINITION_FORMATION('','',#699); +#699 = PRODUCT('bracket','bracket','',(#700)); +#700 = PRODUCT_CONTEXT('',#2,'mechanical'); +#701 = PRODUCT_DEFINITION_CONTEXT('part definition',#2,'design'); +#702 = ADVANCED_BREP_SHAPE_REPRESENTATION('',(#11,#703),#1033); +#703 = MANIFOLD_SOLID_BREP('',#704); +#704 = CLOSED_SHELL('',(#705,#825,#925,#972,#1019,#1026)); +#705 = ADVANCED_FACE('',(#706),#720,.F.); +#706 = FACE_BOUND('',#707,.F.); +#707 = EDGE_LOOP('',(#708,#743,#771,#799)); +#708 = ORIENTED_EDGE('',*,*,#709,.F.); +#709 = EDGE_CURVE('',#710,#712,#714,.T.); +#710 = VERTEX_POINT('',#711); +#711 = CARTESIAN_POINT('',(45.,0.,0.)); +#712 = VERTEX_POINT('',#713); +#713 = CARTESIAN_POINT('',(45.,0.,6.)); +#714 = SURFACE_CURVE('',#715,(#719,#731),.PCURVE_S1.); +#715 = LINE('',#716,#717); +#716 = CARTESIAN_POINT('',(45.,0.,0.)); +#717 = VECTOR('',#718,1.); +#718 = DIRECTION('',(0.,0.,1.)); +#719 = PCURVE('',#720,#725); +#720 = PLANE('',#721); +#721 = AXIS2_PLACEMENT_3D('',#722,#723,#724); +#722 = CARTESIAN_POINT('',(45.,0.,0.)); +#723 = DIRECTION('',(1.,0.,-0.)); +#724 = DIRECTION('',(0.,0.,1.)); +#725 = DEFINITIONAL_REPRESENTATION('',(#726),#730); +#726 = LINE('',#727,#728); +#727 = CARTESIAN_POINT('',(0.,0.)); +#728 = VECTOR('',#729,1.); +#729 = DIRECTION('',(1.,0.)); +#730 = ( GEOMETRIC_REPRESENTATION_CONTEXT(2) +PARAMETRIC_REPRESENTATION_CONTEXT() REPRESENTATION_CONTEXT('2D SPACE','' + ) ); +#731 = PCURVE('',#732,#737); +#732 = PLANE('',#733); +#733 = AXIS2_PLACEMENT_3D('',#734,#735,#736); +#734 = CARTESIAN_POINT('',(45.,0.,0.)); +#735 = DIRECTION('',(-0.,1.,0.)); +#736 = DIRECTION('',(0.,0.,1.)); +#737 = DEFINITIONAL_REPRESENTATION('',(#738),#742); +#738 = LINE('',#739,#740); +#739 = CARTESIAN_POINT('',(0.,0.)); +#740 = VECTOR('',#741,1.); +#741 = DIRECTION('',(1.,0.)); +#742 = ( GEOMETRIC_REPRESENTATION_CONTEXT(2) +PARAMETRIC_REPRESENTATION_CONTEXT() REPRESENTATION_CONTEXT('2D SPACE','' + ) ); +#743 = ORIENTED_EDGE('',*,*,#744,.T.); +#744 = EDGE_CURVE('',#710,#745,#747,.T.); +#745 = VERTEX_POINT('',#746); +#746 = CARTESIAN_POINT('',(45.,12.,0.)); +#747 = SURFACE_CURVE('',#748,(#752,#759),.PCURVE_S1.); +#748 = LINE('',#749,#750); +#749 = CARTESIAN_POINT('',(45.,0.,0.)); +#750 = VECTOR('',#751,1.); +#751 = DIRECTION('',(-0.,1.,0.)); +#752 = PCURVE('',#720,#753); +#753 = DEFINITIONAL_REPRESENTATION('',(#754),#758); +#754 = LINE('',#755,#756); +#755 = CARTESIAN_POINT('',(0.,0.)); +#756 = VECTOR('',#757,1.); +#757 = DIRECTION('',(0.,-1.)); +#758 = ( GEOMETRIC_REPRESENTATION_CONTEXT(2) +PARAMETRIC_REPRESENTATION_CONTEXT() REPRESENTATION_CONTEXT('2D SPACE','' + ) ); +#759 = PCURVE('',#760,#765); +#760 = PLANE('',#761); +#761 = AXIS2_PLACEMENT_3D('',#762,#763,#764); +#762 = CARTESIAN_POINT('',(45.,0.,0.)); +#763 = DIRECTION('',(0.,0.,1.)); +#764 = DIRECTION('',(1.,0.,-0.)); +#765 = DEFINITIONAL_REPRESENTATION('',(#766),#770); +#766 = LINE('',#767,#768); +#767 = CARTESIAN_POINT('',(0.,0.)); +#768 = VECTOR('',#769,1.); +#769 = DIRECTION('',(0.,1.)); +#770 = ( GEOMETRIC_REPRESENTATION_CONTEXT(2) +PARAMETRIC_REPRESENTATION_CONTEXT() REPRESENTATION_CONTEXT('2D SPACE','' + ) ); +#771 = ORIENTED_EDGE('',*,*,#772,.T.); +#772 = EDGE_CURVE('',#745,#773,#775,.T.); +#773 = VERTEX_POINT('',#774); +#774 = CARTESIAN_POINT('',(45.,12.,6.)); +#775 = SURFACE_CURVE('',#776,(#780,#787),.PCURVE_S1.); +#776 = LINE('',#777,#778); +#777 = CARTESIAN_POINT('',(45.,12.,0.)); +#778 = VECTOR('',#779,1.); +#779 = DIRECTION('',(0.,0.,1.)); +#780 = PCURVE('',#720,#781); +#781 = DEFINITIONAL_REPRESENTATION('',(#782),#786); +#782 = LINE('',#783,#784); +#783 = CARTESIAN_POINT('',(0.,-12.)); +#784 = VECTOR('',#785,1.); +#785 = DIRECTION('',(1.,0.)); +#786 = ( GEOMETRIC_REPRESENTATION_CONTEXT(2) +PARAMETRIC_REPRESENTATION_CONTEXT() REPRESENTATION_CONTEXT('2D SPACE','' + ) ); +#787 = PCURVE('',#788,#793); +#788 = PLANE('',#789); +#789 = AXIS2_PLACEMENT_3D('',#790,#791,#792); +#790 = CARTESIAN_POINT('',(45.,12.,0.)); +#791 = DIRECTION('',(-0.,1.,0.)); +#792 = DIRECTION('',(0.,0.,1.)); +#793 = DEFINITIONAL_REPRESENTATION('',(#794),#798); +#794 = LINE('',#795,#796); +#795 = CARTESIAN_POINT('',(0.,0.)); +#796 = VECTOR('',#797,1.); +#797 = DIRECTION('',(1.,0.)); +#798 = ( GEOMETRIC_REPRESENTATION_CONTEXT(2) +PARAMETRIC_REPRESENTATION_CONTEXT() REPRESENTATION_CONTEXT('2D SPACE','' + ) ); +#799 = ORIENTED_EDGE('',*,*,#800,.F.); +#800 = EDGE_CURVE('',#712,#773,#801,.T.); +#801 = SURFACE_CURVE('',#802,(#806,#813),.PCURVE_S1.); +#802 = LINE('',#803,#804); +#803 = CARTESIAN_POINT('',(45.,0.,6.)); +#804 = VECTOR('',#805,1.); +#805 = DIRECTION('',(-0.,1.,0.)); +#806 = PCURVE('',#720,#807); +#807 = DEFINITIONAL_REPRESENTATION('',(#808),#812); +#808 = LINE('',#809,#810); +#809 = CARTESIAN_POINT('',(6.,0.)); +#810 = VECTOR('',#811,1.); +#811 = DIRECTION('',(0.,-1.)); +#812 = ( GEOMETRIC_REPRESENTATION_CONTEXT(2) +PARAMETRIC_REPRESENTATION_CONTEXT() REPRESENTATION_CONTEXT('2D SPACE','' + ) ); +#813 = PCURVE('',#814,#819); +#814 = PLANE('',#815); +#815 = AXIS2_PLACEMENT_3D('',#816,#817,#818); +#816 = CARTESIAN_POINT('',(45.,0.,6.)); +#817 = DIRECTION('',(0.,0.,1.)); +#818 = DIRECTION('',(1.,0.,-0.)); +#819 = DEFINITIONAL_REPRESENTATION('',(#820),#824); +#820 = LINE('',#821,#822); +#821 = CARTESIAN_POINT('',(0.,0.)); +#822 = VECTOR('',#823,1.); +#823 = DIRECTION('',(0.,1.)); +#824 = ( GEOMETRIC_REPRESENTATION_CONTEXT(2) +PARAMETRIC_REPRESENTATION_CONTEXT() REPRESENTATION_CONTEXT('2D SPACE','' + ) ); +#825 = ADVANCED_FACE('',(#826),#840,.T.); +#826 = FACE_BOUND('',#827,.T.); +#827 = EDGE_LOOP('',(#828,#858,#881,#904)); +#828 = ORIENTED_EDGE('',*,*,#829,.F.); +#829 = EDGE_CURVE('',#830,#832,#834,.T.); +#830 = VERTEX_POINT('',#831); +#831 = CARTESIAN_POINT('',(57.,0.,0.)); +#832 = VERTEX_POINT('',#833); +#833 = CARTESIAN_POINT('',(57.,0.,6.)); +#834 = SURFACE_CURVE('',#835,(#839,#851),.PCURVE_S1.); +#835 = LINE('',#836,#837); +#836 = CARTESIAN_POINT('',(57.,0.,0.)); +#837 = VECTOR('',#838,1.); +#838 = DIRECTION('',(0.,0.,1.)); +#839 = PCURVE('',#840,#845); +#840 = PLANE('',#841); +#841 = AXIS2_PLACEMENT_3D('',#842,#843,#844); +#842 = CARTESIAN_POINT('',(57.,0.,0.)); +#843 = DIRECTION('',(1.,0.,-0.)); +#844 = DIRECTION('',(0.,0.,1.)); +#845 = DEFINITIONAL_REPRESENTATION('',(#846),#850); +#846 = LINE('',#847,#848); +#847 = CARTESIAN_POINT('',(0.,0.)); +#848 = VECTOR('',#849,1.); +#849 = DIRECTION('',(1.,0.)); +#850 = ( GEOMETRIC_REPRESENTATION_CONTEXT(2) +PARAMETRIC_REPRESENTATION_CONTEXT() REPRESENTATION_CONTEXT('2D SPACE','' + ) ); +#851 = PCURVE('',#732,#852); +#852 = DEFINITIONAL_REPRESENTATION('',(#853),#857); +#853 = LINE('',#854,#855); +#854 = CARTESIAN_POINT('',(0.,12.)); +#855 = VECTOR('',#856,1.); +#856 = DIRECTION('',(1.,0.)); +#857 = ( GEOMETRIC_REPRESENTATION_CONTEXT(2) +PARAMETRIC_REPRESENTATION_CONTEXT() REPRESENTATION_CONTEXT('2D SPACE','' + ) ); +#858 = ORIENTED_EDGE('',*,*,#859,.T.); +#859 = EDGE_CURVE('',#830,#860,#862,.T.); +#860 = VERTEX_POINT('',#861); +#861 = CARTESIAN_POINT('',(57.,12.,0.)); +#862 = SURFACE_CURVE('',#863,(#867,#874),.PCURVE_S1.); +#863 = LINE('',#864,#865); +#864 = CARTESIAN_POINT('',(57.,0.,0.)); +#865 = VECTOR('',#866,1.); +#866 = DIRECTION('',(-0.,1.,0.)); +#867 = PCURVE('',#840,#868); +#868 = DEFINITIONAL_REPRESENTATION('',(#869),#873); +#869 = LINE('',#870,#871); +#870 = CARTESIAN_POINT('',(0.,0.)); +#871 = VECTOR('',#872,1.); +#872 = DIRECTION('',(0.,-1.)); +#873 = ( GEOMETRIC_REPRESENTATION_CONTEXT(2) +PARAMETRIC_REPRESENTATION_CONTEXT() REPRESENTATION_CONTEXT('2D SPACE','' + ) ); +#874 = PCURVE('',#760,#875); +#875 = DEFINITIONAL_REPRESENTATION('',(#876),#880); +#876 = LINE('',#877,#878); +#877 = CARTESIAN_POINT('',(12.,0.)); +#878 = VECTOR('',#879,1.); +#879 = DIRECTION('',(0.,1.)); +#880 = ( GEOMETRIC_REPRESENTATION_CONTEXT(2) +PARAMETRIC_REPRESENTATION_CONTEXT() REPRESENTATION_CONTEXT('2D SPACE','' + ) ); +#881 = ORIENTED_EDGE('',*,*,#882,.T.); +#882 = EDGE_CURVE('',#860,#883,#885,.T.); +#883 = VERTEX_POINT('',#884); +#884 = CARTESIAN_POINT('',(57.,12.,6.)); +#885 = SURFACE_CURVE('',#886,(#890,#897),.PCURVE_S1.); +#886 = LINE('',#887,#888); +#887 = CARTESIAN_POINT('',(57.,12.,0.)); +#888 = VECTOR('',#889,1.); +#889 = DIRECTION('',(0.,0.,1.)); +#890 = PCURVE('',#840,#891); +#891 = DEFINITIONAL_REPRESENTATION('',(#892),#896); +#892 = LINE('',#893,#894); +#893 = CARTESIAN_POINT('',(0.,-12.)); +#894 = VECTOR('',#895,1.); +#895 = DIRECTION('',(1.,0.)); +#896 = ( GEOMETRIC_REPRESENTATION_CONTEXT(2) +PARAMETRIC_REPRESENTATION_CONTEXT() REPRESENTATION_CONTEXT('2D SPACE','' + ) ); +#897 = PCURVE('',#788,#898); +#898 = DEFINITIONAL_REPRESENTATION('',(#899),#903); +#899 = LINE('',#900,#901); +#900 = CARTESIAN_POINT('',(0.,12.)); +#901 = VECTOR('',#902,1.); +#902 = DIRECTION('',(1.,0.)); +#903 = ( GEOMETRIC_REPRESENTATION_CONTEXT(2) +PARAMETRIC_REPRESENTATION_CONTEXT() REPRESENTATION_CONTEXT('2D SPACE','' + ) ); +#904 = ORIENTED_EDGE('',*,*,#905,.F.); +#905 = EDGE_CURVE('',#832,#883,#906,.T.); +#906 = SURFACE_CURVE('',#907,(#911,#918),.PCURVE_S1.); +#907 = LINE('',#908,#909); +#908 = CARTESIAN_POINT('',(57.,0.,6.)); +#909 = VECTOR('',#910,1.); +#910 = DIRECTION('',(-0.,1.,0.)); +#911 = PCURVE('',#840,#912); +#912 = DEFINITIONAL_REPRESENTATION('',(#913),#917); +#913 = LINE('',#914,#915); +#914 = CARTESIAN_POINT('',(6.,0.)); +#915 = VECTOR('',#916,1.); +#916 = DIRECTION('',(0.,-1.)); +#917 = ( GEOMETRIC_REPRESENTATION_CONTEXT(2) +PARAMETRIC_REPRESENTATION_CONTEXT() REPRESENTATION_CONTEXT('2D SPACE','' + ) ); +#918 = PCURVE('',#814,#919); +#919 = DEFINITIONAL_REPRESENTATION('',(#920),#924); +#920 = LINE('',#921,#922); +#921 = CARTESIAN_POINT('',(12.,0.)); +#922 = VECTOR('',#923,1.); +#923 = DIRECTION('',(0.,1.)); +#924 = ( GEOMETRIC_REPRESENTATION_CONTEXT(2) +PARAMETRIC_REPRESENTATION_CONTEXT() REPRESENTATION_CONTEXT('2D SPACE','' + ) ); +#925 = ADVANCED_FACE('',(#926),#732,.F.); +#926 = FACE_BOUND('',#927,.F.); +#927 = EDGE_LOOP('',(#928,#949,#950,#971)); +#928 = ORIENTED_EDGE('',*,*,#929,.F.); +#929 = EDGE_CURVE('',#710,#830,#930,.T.); +#930 = SURFACE_CURVE('',#931,(#935,#942),.PCURVE_S1.); +#931 = LINE('',#932,#933); +#932 = CARTESIAN_POINT('',(45.,0.,0.)); +#933 = VECTOR('',#934,1.); +#934 = DIRECTION('',(1.,0.,-0.)); +#935 = PCURVE('',#732,#936); +#936 = DEFINITIONAL_REPRESENTATION('',(#937),#941); +#937 = LINE('',#938,#939); +#938 = CARTESIAN_POINT('',(0.,0.)); +#939 = VECTOR('',#940,1.); +#940 = DIRECTION('',(0.,1.)); +#941 = ( GEOMETRIC_REPRESENTATION_CONTEXT(2) +PARAMETRIC_REPRESENTATION_CONTEXT() REPRESENTATION_CONTEXT('2D SPACE','' + ) ); +#942 = PCURVE('',#760,#943); +#943 = DEFINITIONAL_REPRESENTATION('',(#944),#948); +#944 = LINE('',#945,#946); +#945 = CARTESIAN_POINT('',(0.,0.)); +#946 = VECTOR('',#947,1.); +#947 = DIRECTION('',(1.,0.)); +#948 = ( GEOMETRIC_REPRESENTATION_CONTEXT(2) +PARAMETRIC_REPRESENTATION_CONTEXT() REPRESENTATION_CONTEXT('2D SPACE','' + ) ); +#949 = ORIENTED_EDGE('',*,*,#709,.T.); +#950 = ORIENTED_EDGE('',*,*,#951,.T.); +#951 = EDGE_CURVE('',#712,#832,#952,.T.); +#952 = SURFACE_CURVE('',#953,(#957,#964),.PCURVE_S1.); +#953 = LINE('',#954,#955); +#954 = CARTESIAN_POINT('',(45.,0.,6.)); +#955 = VECTOR('',#956,1.); +#956 = DIRECTION('',(1.,0.,-0.)); +#957 = PCURVE('',#732,#958); +#958 = DEFINITIONAL_REPRESENTATION('',(#959),#963); +#959 = LINE('',#960,#961); +#960 = CARTESIAN_POINT('',(6.,0.)); +#961 = VECTOR('',#962,1.); +#962 = DIRECTION('',(0.,1.)); +#963 = ( GEOMETRIC_REPRESENTATION_CONTEXT(2) +PARAMETRIC_REPRESENTATION_CONTEXT() REPRESENTATION_CONTEXT('2D SPACE','' + ) ); +#964 = PCURVE('',#814,#965); +#965 = DEFINITIONAL_REPRESENTATION('',(#966),#970); +#966 = LINE('',#967,#968); +#967 = CARTESIAN_POINT('',(0.,0.)); +#968 = VECTOR('',#969,1.); +#969 = DIRECTION('',(1.,0.)); +#970 = ( GEOMETRIC_REPRESENTATION_CONTEXT(2) +PARAMETRIC_REPRESENTATION_CONTEXT() REPRESENTATION_CONTEXT('2D SPACE','' + ) ); +#971 = ORIENTED_EDGE('',*,*,#829,.F.); +#972 = ADVANCED_FACE('',(#973),#788,.T.); +#973 = FACE_BOUND('',#974,.T.); +#974 = EDGE_LOOP('',(#975,#996,#997,#1018)); +#975 = ORIENTED_EDGE('',*,*,#976,.F.); +#976 = EDGE_CURVE('',#745,#860,#977,.T.); +#977 = SURFACE_CURVE('',#978,(#982,#989),.PCURVE_S1.); +#978 = LINE('',#979,#980); +#979 = CARTESIAN_POINT('',(45.,12.,0.)); +#980 = VECTOR('',#981,1.); +#981 = DIRECTION('',(1.,0.,-0.)); +#982 = PCURVE('',#788,#983); +#983 = DEFINITIONAL_REPRESENTATION('',(#984),#988); +#984 = LINE('',#985,#986); +#985 = CARTESIAN_POINT('',(0.,0.)); +#986 = VECTOR('',#987,1.); +#987 = DIRECTION('',(0.,1.)); +#988 = ( GEOMETRIC_REPRESENTATION_CONTEXT(2) +PARAMETRIC_REPRESENTATION_CONTEXT() REPRESENTATION_CONTEXT('2D SPACE','' + ) ); +#989 = PCURVE('',#760,#990); +#990 = DEFINITIONAL_REPRESENTATION('',(#991),#995); +#991 = LINE('',#992,#993); +#992 = CARTESIAN_POINT('',(0.,12.)); +#993 = VECTOR('',#994,1.); +#994 = DIRECTION('',(1.,0.)); +#995 = ( GEOMETRIC_REPRESENTATION_CONTEXT(2) +PARAMETRIC_REPRESENTATION_CONTEXT() REPRESENTATION_CONTEXT('2D SPACE','' + ) ); +#996 = ORIENTED_EDGE('',*,*,#772,.T.); +#997 = ORIENTED_EDGE('',*,*,#998,.T.); +#998 = EDGE_CURVE('',#773,#883,#999,.T.); +#999 = SURFACE_CURVE('',#1000,(#1004,#1011),.PCURVE_S1.); +#1000 = LINE('',#1001,#1002); +#1001 = CARTESIAN_POINT('',(45.,12.,6.)); +#1002 = VECTOR('',#1003,1.); +#1003 = DIRECTION('',(1.,0.,-0.)); +#1004 = PCURVE('',#788,#1005); +#1005 = DEFINITIONAL_REPRESENTATION('',(#1006),#1010); +#1006 = LINE('',#1007,#1008); +#1007 = CARTESIAN_POINT('',(6.,0.)); +#1008 = VECTOR('',#1009,1.); +#1009 = DIRECTION('',(0.,1.)); +#1010 = ( GEOMETRIC_REPRESENTATION_CONTEXT(2) +PARAMETRIC_REPRESENTATION_CONTEXT() REPRESENTATION_CONTEXT('2D SPACE','' + ) ); +#1011 = PCURVE('',#814,#1012); +#1012 = DEFINITIONAL_REPRESENTATION('',(#1013),#1017); +#1013 = LINE('',#1014,#1015); +#1014 = CARTESIAN_POINT('',(0.,12.)); +#1015 = VECTOR('',#1016,1.); +#1016 = DIRECTION('',(1.,0.)); +#1017 = ( GEOMETRIC_REPRESENTATION_CONTEXT(2) +PARAMETRIC_REPRESENTATION_CONTEXT() REPRESENTATION_CONTEXT('2D SPACE','' + ) ); +#1018 = ORIENTED_EDGE('',*,*,#882,.F.); +#1019 = ADVANCED_FACE('',(#1020),#760,.F.); +#1020 = FACE_BOUND('',#1021,.F.); +#1021 = EDGE_LOOP('',(#1022,#1023,#1024,#1025)); +#1022 = ORIENTED_EDGE('',*,*,#744,.F.); +#1023 = ORIENTED_EDGE('',*,*,#929,.T.); +#1024 = ORIENTED_EDGE('',*,*,#859,.T.); +#1025 = ORIENTED_EDGE('',*,*,#976,.F.); +#1026 = ADVANCED_FACE('',(#1027),#814,.T.); +#1027 = FACE_BOUND('',#1028,.T.); +#1028 = EDGE_LOOP('',(#1029,#1030,#1031,#1032)); +#1029 = ORIENTED_EDGE('',*,*,#800,.F.); +#1030 = ORIENTED_EDGE('',*,*,#951,.T.); +#1031 = ORIENTED_EDGE('',*,*,#905,.T.); +#1032 = ORIENTED_EDGE('',*,*,#998,.F.); +#1033 = ( GEOMETRIC_REPRESENTATION_CONTEXT(3) +GLOBAL_UNCERTAINTY_ASSIGNED_CONTEXT((#1037)) +GLOBAL_UNIT_ASSIGNED_CONTEXT((#1034,#1035,#1036)) REPRESENTATION_CONTEXT +('Context #1','3D Context with UNIT and UNCERTAINTY') ); +#1034 = ( LENGTH_UNIT() NAMED_UNIT(*) SI_UNIT(.MILLI.,.METRE.) ); +#1035 = ( NAMED_UNIT(*) PLANE_ANGLE_UNIT() SI_UNIT($,.RADIAN.) ); +#1036 = ( NAMED_UNIT(*) SI_UNIT($,.STERADIAN.) SOLID_ANGLE_UNIT() ); +#1037 = UNCERTAINTY_MEASURE_WITH_UNIT(LENGTH_MEASURE(1.E-07),#1034, + 'distance_accuracy_value','confusion accuracy'); +#1038 = PRODUCT_RELATED_PRODUCT_CATEGORY('part',$,(#699)); +ENDSEC; +END-ISO-10303-21; diff --git a/tests/libslic3r/CMakeLists.txt b/tests/libslic3r/CMakeLists.txt index ef42a5e897..bf3981f519 100644 --- a/tests/libslic3r/CMakeLists.txt +++ b/tests/libslic3r/CMakeLists.txt @@ -29,6 +29,7 @@ add_executable(${_TEST_NAME}_tests test_mutable_polygon.cpp test_mutable_priority_queue.cpp test_nozzle_volume_type.cpp + test_step.cpp test_stl.cpp test_triangle_selector.cpp test_meshboolean.cpp diff --git a/tests/libslic3r/test_step.cpp b/tests/libslic3r/test_step.cpp new file mode 100644 index 0000000000..a2aa7218f1 --- /dev/null +++ b/tests/libslic3r/test_step.cpp @@ -0,0 +1,93 @@ +#include + +#include + +#include "libslic3r/Model.hpp" +#include "libslic3r/Format/STEP.hpp" +#include "test_utils.hpp" + +using namespace Slic3r; + +static void write_step_line(const std::string &path, const std::string &line) +{ + boost::nowide::ofstream file(path, std::ios::binary); + file << "ISO-10303-21;\n" << line << "\nEND-ISO-10303-21;\n"; +} + +// preprocess() hands back the input path unless it transcoded into a temporary. +static std::string preprocess_result(const std::string &line) +{ + ScopedSlic3rTemporaryDir scratch; + + ScopedTemporaryFile step(".step"); + write_step_line(step.string(), line); + + std::string output_path; + StepPreProcessor preprocessor; + REQUIRE(preprocessor.preprocess(step.string().c_str(), output_path)); + + return output_path == step.string() ? "untouched" : "transcoded"; +} + +// data/utf8_part_names.step is three boxes written by OCCT's own STEP writer, whose +// PRODUCT names were then patched to raw UTF-8. Most CAD exporters write non-ASCII names +// that way rather than in the \X2\ escape form. The third part is ASCII, as a control. +TEST_CASE("Part names with multi-byte UTF-8 survive import", "[Step]") +{ + // getNamedSolids() replaces a name that isUtf8() rejects with a running number. + const std::string path = TEST_DATA_DIR PATH_SEPARATOR "utf8_part_names.step"; + + Model model; + bool cancel = false; + Step step(path); // no isUtf8Fn, matching how Model::read_from_step builds it + + REQUIRE(step.load() == Step::Step_Status::LOAD_SUCCESS); + REQUIRE(step.mesh(&model, cancel, false) == Step::Step_Status::MESH_SUCCESS); + + REQUIRE(model.objects.size() == 1); + const ModelObject *object = model.objects.front(); + REQUIRE(object->volumes.size() == 3); + // "ce" is split off, or the hex escape would swallow it as further hex digits. + CHECK(object->volumes[0]->name == "pi\xC3\xA8" "ce"); + CHECK(object->volumes[1]->name == "Geh\xC3\xA4use"); + CHECK(object->volumes[2]->name == "bracket"); +} + +TEST_CASE("isUtf8 recognises two, three and four byte sequences", "[Step]") +{ + CHECK(StepPreProcessor::isUtf8("\xC3\xA9")); // U+00E9 + CHECK(StepPreProcessor::isUtf8("\xE4\xB8\xAD")); // U+4E2D + CHECK(StepPreProcessor::isUtf8("\xF0\x9F\x94\xA9")); // U+1F529 + CHECK_FALSE(StepPreProcessor::isUtf8("\x81\x30")); // 0x81 is not a lead byte + CHECK_FALSE(StepPreProcessor::isUtf8("\xC3")); // truncated sequence +} + +// The only caller of isGBK is preprocess(), which nothing calls today. +TEST_CASE("Encoding detection decides whether a step file is transcoded", "[Step]") +{ + SECTION("UTF-8, so left alone") + { + // A two byte sequence also satisfies every GBK range, so misdetecting it as + // not-UTF-8 sends it to be transcoded. + const std::string sequence = GENERATE(std::string("\xC3\xA9"), // U+00E9 + std::string("\xE4\xB8\xAD"), // U+4E2D + std::string("\xF0\x9F\x94\xA9")); // U+1F529 + + CHECK(preprocess_result("NAME('" + sequence + "');") == "untouched"); + } + + SECTION("neither UTF-8 nor GBK, so left alone") + { + // 0x81 is not a UTF-8 lead byte, and 0x30 is below the 0x40 floor for a GBK trail. + CHECK(preprocess_result("NAME('\x81\x30');") == "untouched"); + } + + SECTION("GBK, so transcoded") + { + // U+554A in GBK, whose lead byte is not valid UTF-8. Pins the other direction, + // since a detector that never reports GBK would pass every case above. + CHECK(preprocess_result("NAME('\xB0\xA1');") == "transcoded"); + } + + SECTION("plain ASCII, so left alone") { CHECK(preprocess_result("NAME('bracket');") == "untouched"); } +} diff --git a/tests/test_utils.hpp b/tests/test_utils.hpp index 97e684fd6e..e3fbbe8fab 100644 --- a/tests/test_utils.hpp +++ b/tests/test_utils.hpp @@ -4,6 +4,7 @@ #include #include #include +#include #include @@ -32,7 +33,7 @@ inline Slic3r::TriangleMesh load_model(const std::string &obj_filename) // --------------------------------------------------------------------------- // Owns a unique path under the system temp dir, "-[]" -// (parallel-safe, cross-platform). Shared base for the two RAII temp guards below. +// (parallel-safe, cross-platform). Shared base for the RAII temp guards below. class ScopedTemporaryPath { public: @@ -70,6 +71,24 @@ public: ~ScopedTemporaryDir() { boost::system::error_code ec; boost::filesystem::remove_all(m_path, ec); } }; +// A temp directory that is also Slic3r::temporary_dir() for its lifetime. No test +// process sets that global, so code under test which writes there (for example +// StepPreProcessor::preprocess) lands at the filesystem root. Restored on scope exit +// even when an assertion throws, so it cannot leak into later tests. +class ScopedSlic3rTemporaryDir : public ScopedTemporaryDir +{ +public: + explicit ScopedSlic3rTemporaryDir(const std::string &prefix = "orca") + : ScopedTemporaryDir(prefix), m_previous(Slic3r::temporary_dir()) + { Slic3r::set_temporary_dir(string()); } + // Runs before ~ScopedTemporaryDir, so the setting goes back while the directory + // it names still exists. + ~ScopedSlic3rTemporaryDir() { Slic3r::set_temporary_dir(m_previous); } + +private: + const std::string m_previous; +}; + // --------------------------------------------------------------------------- // Debug-only test artifacts //