leocad icon indicating copy to clipboard operation
leocad copied to clipboard

Helpers and Third Party parts are not shown in the "Parts" list

Open u2fly opened this issue 1 year ago • 3 comments

Describe the bug

"Helpers" and "Third Party" parts, which names starts with "|" (Vertical bar, U+007C), are not shown in "Parts" list.

UPDATE: Parts with "|" in the prefixes are shown only in "All Parts" list, but not in categories they are assigned to.

But such parts are visible via "Prefernces > Categories > Unassigned" and its possible to create a custom category with such parts via "Preferences > Categories" (even assigned to newly created catgories such parts still are invisible in the parts list).

To Reproduce

Steps to reproduce the behavior:

  1. Install latest LDraw Parts Library (both complete.zip and ldrawunf.zip from https://library.ldraw.org);
  2. Try to find in "Parts" list parts with the names started with "|" symbol

Expected behavior

LeoCAD should support "Helpers" and "Third Party" parts to be shown in the "Parts" list.

If there is no categories "Helpers" and "Third Party" yet, then "Helpers" and "Third Party" parts should be shown in "All Parts" category.

Screenshots

LeoCAD_helpers1

LeoCAD_helpers2

Version (please complete the following information):

  • OS: Debian
  • LeoCAD Version: continuous

Crash information:

None

Additional context

Its now allowed to include "Helpers" and "Third Party" parts to the official LDraw Parts Library.

Both these categories has parts named with the "|" prefix character.

u2fly avatar Oct 10 '24 23:10 u2fly

similar to #394 ?

nathaneltitane avatar Oct 11 '24 15:10 nathaneltitane

No, #394 could be simple fixed with switching to "All Parts" in "Parts" list.

@nathaneltitane, Actual issue is about parts started with some Special Prefix Characters (as you mentioned = in https://github.com/leozide/leocad/issues/394#issuecomment-569435556):

Actually in LeoCAD, parts with ~ and _ prefixes are visible in "Parts" list.

But parts with = (including _=, ~=, etc.) and | (including ~|, _~|, =|, _=|, etc.) prefixes are invisible in "Parts" list.

  • https://www.ldraw.org/article/398.html#descprefix

Special Prefix Characters

Some programs rely on the parts.lst file rather than the LDRAW_ORG meta-statement. Special prefix characters are added to the start of the part description to prevent the parts being included in the list by these programs:

  • The descriptions of all subparts (i.e. line 4 = '0 !LDRAW_ORG Subpart') must start with '~'
  • The description of all obsolete parts, maintained for backwards compatibility must start with '~'
  • The use of '~' for non "s" part files is at the author's discretion, to hide mouldings that are not released independently. This is one case where merely reading the LDRAW_ORG line is insufficient for tools to know how to treat the file.
  • The descriptions of all aliases (i.e. line 4 = '0 !LDRAW_ORG Part Alias') must start with '='
  • The descriptions of all third party parts must start with '|' or '~|' (as appropriate)
  • The descriptions of all physical colour parts (i.e. line 4 = '0 !LDRAW_ORG Part Physical_Colour') should start with '_' (This usage is depreciated)

Possible solution

@leozide, In LeoCAD there should be "Helpers" category added for parts in Parts Library parts/helpers/ folder and for parts with !CATEGORY Helpers;

Also, there should be extra checkbox options added to "Parts" list settings (or to "Preferences > Categories"):

  • "[ ] Show obsolete parts" (for parts with ~ in prefix; actually turned ON by default)

  • "[ ] Show colored parts" (for parts with _ in prefix; actually turned ON by default)

  • "[ ] Show alias parts" (for parts with = in prefix)

  • "[ ] Show Third Party parts" (for parts with | in prefix and/or with !CATEGORY Third Party)

  • Third Party parts policies: https://www.ldraw.org/pt-policies.html

    • Discussion: https://forums.ldraw.org/thread-21841.html
  • Helpers parts spec draft: https://www.ldraw.org/draft-documents/helper-parts.html

    • Discussion: https://forums.ldraw.org/thread-24904.html?highlight=helper

As Third Party parts (with | and/or !CATEGORY Third Party) could be in various categories, adding "Third Party" category in LeoCAD is not needed (users may create "Third Party" category via "Preferences > Categories" itself if needed)

Also, as all "Helpers" should be named with 0 |Helper ... and there is no !CATEGORY in such files, software such LeoCAD should use its first word (without ~_=| prefixes) in the first line of file as category (i.e., such files should identified as with !CATEGORY Helper).

All "Helpers" are stored in are stored in parts/helpers/ subfolder in Parts Library.

Sample

Sample "Helper 2D Ruler 100 LDU" part:

  • https://library.ldraw.org/tracker/37573
    • https://library.ldraw.org/library/unofficial/parts/helpers/helper2druler100ldu.dat

u2fly avatar Oct 11 '24 16:10 u2fly

@leozide, Addition on this issue:

  1. Parts with ~_=| prefixes are shown in "All Parts" list;
  2. But, parts with | in the prefixes are not shown in appropriate categories, even such parts has !CATEGORY command defined.
  3. If create a new category with matching keywords, parts with | in the prefixes appears in a such new category;
  4. All parts with | in the prefixes are recognized as "Decorated Parts", even there are parts not decorated at all.

u2fly avatar Oct 17 '24 09:10 u2fly