Giter Site home page Giter Site logo

Comments (18)

shaise avatar shaise commented on July 22, 2024 1

Hi @bgbsww ,
Thank you for your reply.
Here is how it goes:
A sheetmetal feature holds the selected faces it was built upon like this

        obj.addProperty(
            "App::PropertyLinkSub", "baseObject", "Parameters", _tip_
        ).baseObject = (selobj.Object, selobj.SubElementNames)

the SubElementNames is a list of faces / edges returned from the getSelectionEx command which return plain names.
however when I read back the baseObject property it returns the full TNP name.

For now, as a workaround, I just clean the TNP name. Testing the same on FreeCad Link version, baseObject return the simple name, as expected.

shai

from freecad_sheetmetal.

shaise avatar shaise commented on July 22, 2024

Is this freecad version with the new topological naming enabled?

from freecad_sheetmetal.

JaapStruyk avatar JaapStruyk commented on July 22, 2024

No idea, stock appimage from weekly builds so presume not, btw starting with a sheetmetal base shape works fine, just found out then when saving, closing and reopening the drawing it's working as it should so think it's FreeCAD related not the sheetmetal workbench.

from freecad_sheetmetal.

shaise avatar shaise commented on July 22, 2024

The ;g543;SKT;:Hc32,E;:G;XTR;:7,F.Face3 instead of just Face3 hints that the TNP is already enabled. I never tested it with TNP. I will investigate. Thanks!

from freecad_sheetmetal.

JaapStruyk avatar JaapStruyk commented on July 22, 2024

It looks that TNP is used while working but gets lost when saving/reopening, on re-edit it's TNP again. Looks like a freecad bug in this release but does show a tiny bottleneck with sheetmetal if TNP is applied defenatly.
Thanks for helping!

from freecad_sheetmetal.

shaise avatar shaise commented on July 22, 2024

I will investigate if sheetmetal might collide with TNP.

from freecad_sheetmetal.

shaise avatar shaise commented on July 22, 2024

@JaapStruyk , I have added some code to bypass the TNP issue. please update and test

from freecad_sheetmetal.

JaapStruyk avatar JaapStruyk commented on July 22, 2024

Looks like you nailed it ;-) tried a couple of things but couldn't find trouble, thanks for the quick responce.

from freecad_sheetmetal.

GS90 avatar GS90 commented on July 22, 2024

Hello,
Unfortunately, after the TNP problem was fixed, the models of sheet metal parts stopped working correctly.
Errors appear after saving and reopening files.

FreeCAD info (latest weekly-build):

OS: Ubuntu 22.04.4 LTS (XFCE/xfce)
Word size of FreeCAD: 64-bit
Version: 0.22.0dev.37668 (Git) AppImage
Build type: Release
Branch: main
Hash: ea68c5e88cdc80044ede482f6ad908820f4c1c82
Python 3.11.9, Qt 5.15.13, Coin 4.0.2, Vtk 9.2.6, OCC 7.7.2
Locale: English/United States (en_US)
Installed mods: 
  * Assembly4 0.50.13
  * Plot 2022.4.17
  * sheetmetal 0.4.17
  * addFC 0.3.1
  * CfdOF 1.25.17
  * fasteners 0.5.21

Report:

09:59:47  <PropertyLinks> PropertyLinks.cpp(453): Error#Bend.baseObject missing element reference Error#BaseBend ;g5v2;SKT;:Had6,V;:G;OFS;:Had6:7,V;:G;OFS;:Had6:7,V;WIR;:Had6:4,V;:G;XTR;:Had6:7,E;:H,E.Edge2
09:59:47  <PropertyLinks> PropertyLinks.cpp(453): Error#Bend.baseObject missing element reference Error#BaseBend ;g3v1;SKT;:Had6,V;:G;OFS;:Had6:7,V;:G;OFS;:Had6:7,V;WIR;:Had6:4,V;:G;XTR;:Had6:7,E;:G;OFS;:Had6:7,E;:H,E.Edge40
09:59:47  pyException: Traceback (most recent call last):
  File "/home/***/.local/share/FreeCAD/Mod/sheetmetal/./SheetMetalCmd.py", line 1551, in execute
    thk, thkDir = sheet_thk(Main_Object, face[0])
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/***/.local/share/FreeCAD/Mod/sheetmetal/./SheetMetalCmd.py", line 437, in sheet_thk
    selItem = MainObject.getElement(SheetMetalBaseCmd.getElementFromTNP(selFaceName))
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
<class 'ValueError'>: Invalid subelement name
09:59:47  Bend: Invalid subelement name
Error.mp4

Error.zip

from freecad_sheetmetal.

shaise avatar shaise commented on July 22, 2024

ok. I will investigate further more.

from freecad_sheetmetal.

shaise avatar shaise commented on July 22, 2024

@GS90 ,
Thank you for the catch. This is indeed another TNP use case. Please check my fix.

I still think what I do is a workaround. I think .getElement should support TNP, perhaps @bgbsww can way in.

from freecad_sheetmetal.

bgbsww avatar bgbsww commented on July 22, 2024

So the long subelement name is the correct full history name of the element, and as you can see, the tail portion after the dot is the traditional short name. Can you give a specific pointer to where in the FC API you are getting these names, so that I can confirm whether or not they should be visible at that point? My expectation is they would not be and you would just deal with the short name.

from freecad_sheetmetal.

shaise avatar shaise commented on July 22, 2024

@GS90 ,
Thanks, I'll take a look.
Please make a new issue for it. and delete the message from here.

from freecad_sheetmetal.

shaise avatar shaise commented on July 22, 2024

Hi @bgbsww ,

Attached is an example I can not make any workarounds since this time the error is in C++.
load the file, select Bend feature and change the length to say 15.
This is the error:

15:04:41  <Exception> FeatureDressUp.cpp(209): Invalid edge link: ;Edge60;D9d4;:H,E.Edge70
15:04:41  Fillet: Invalid edge link: ;Edge60;D9d4;:H,E.Edge70

Test-SM-TNP.zip

from freecad_sheetmetal.

bgbsww avatar bgbsww commented on July 22, 2024

Thank you! The reference on PropertyLinkSub was super helpful; there are no differences at the python layer, and no differences in the C++ implementation of PropertyLinkSub.

However, it appears that the ComplexGeoData::findElementName which is now Data::findElementName is missing this suspiciously germane clause at the top:

    // skip leading dots
    while(subname && subname[0] == '.')
        ++subname;

I need to keep running this down, but this smells right.

from freecad_sheetmetal.

shaise avatar shaise commented on July 22, 2024

Thanks for all your hard work on TNP!

from freecad_sheetmetal.

bgbsww avatar bgbsww commented on July 22, 2024

With that code in place, your example file fails until I replace Edge70 (one of the fillets), because it has a bad reference, but once that's done it appears to work correctly.

I need to run all the test suites and submit a PR, expect it to be in place soon, and hopefully you won't need the workarounds at that point.

from freecad_sheetmetal.

shaise avatar shaise commented on July 22, 2024

Thanks again!

from freecad_sheetmetal.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.