Geometric classification by entity, layer and color

Hi Mathieu,

2.1. I don’t see the colors when they are displayed using components: “Custom Preview” + “Color Peek”, via SD interface.

  • this should work?
  • Must use “ShapeDiverMaterial”?

thansk you :slight_smile:

I can’t reproduce the problem. The custom preview component should work on ShapeDiver. Do you have a link to a model where I can check the issue?
In any case, you can always try to replace Custom Preview with the ShapeDiverDisplayGeometry component and a ShapeDiverMaterial.

Hi Mathieu,

2.1. You can check a link to a model in this Ref: ae4a28ec-4c97-4a7e-8f29-7425c96a0325
Ill try using ShapeDiverDisplayGeometry…

Thanks!

and it made the same problme with using ShapeDiverDisplayGeometry.
Ref: 1c8ac59c-9d95-45b2-80ab-dd6ca8eff68a
Now I really don’t understand what’s not working for me here …

What did I do wrong?

Thanks.

What is the problem exactly? I just checked the model reference and it was denied by the system, so I can’t really check if the materials are displayed correctly. I’m afraid I did not understand what your issue is.

HI Mathieu,

  1. It was denied by the system because there was nothing to preview.
    amyway - a saperated ShapeDiverDisplayGeometry solved it - makeing sure there is always at least one thing to preview.

  2. I was unable to use “Text Curves” as you explained - because I didn’t understand how to define the font size or type. Right now, I’m using “OpenNest text”, and it seems to work.

  3. We created a mechanism that receives a DXF file and converts it into a list of entities and layers, as follows:

  • entity
  • Layer
  • entity
  • Layer
    and so’…

Entities that gets to enter the list - are just entities that are on the list of DXF entities included in “GEO-UPLOAD” in SD:
POINT
LINE
POLYLINE
LWPOLYLINE
ARC
CIRCLE
SPLINE
MESH
POLYSURFACEMESH
FACE3D

I created the definition needed in GH: the geometry comes from “ShapeDiverGeometryInput”, and the text comes from “ShapeDiverTextfileInput”, I uploaded the SD interface, and it didn’t work, and all layers appires to be “OTHER”:


The definition is here:

After, I tried to perform the operation again, only this time I put the list inside the “pannel” and not through “ShapeDiverTextfileInput”.
In that method it all worked:


The definition is here:

So it seems that the problem is in “ShapeDiverTextfileInput”.
any help?

Thanks!

Attachments for review:

  • DXF file
  • TEXT file
    Thanks!

SIMPLETEST9-2LIST.txt (379 Bytes) SIMPLETEST9.dxf (177.4 KB)

Depending on the text formatting and how the file is stored, using new lines to split the text in your file is not the most reliable way. I would switch to commas instead. Let me know if that workaround would work for you and if it solves the issue.

Hi Mathieu,

  1. When you say “commas” - your intent is instead of the existing list,
    that looks like that:
    POLYLINE
    MARK
    CIRCLE
    OTHER
    CIRCLE
    MARK
    CIRCLE
    REC

    There will be the following list:
    POLYLINE, MARK, CIRCLE, OTHER, CIRCLE, MARK, CIRCLE, REC, …
    ?

  2. Which component do you use to “break” this list into separate rows?

Thanks!

Yes, I would basically format your lists as csv files. Then you can split them using the “Text Split” component. In case you are not using a csv file, you can also make sure to remove all the spaces from your file using “Replace Text” component (replace spaces with nothing).

Hi Mathieu,

  1. Thanks so much for the answer! It was very effective, and solved the problem:


    https://app.shapediver.com/settings/200511-test-for-crv-import-6

  2. I connected this “Layer mechanism” to the main definition we are working on - the “Laser Cutting Automatic System” = LCAS, (which will be one of 5 “apps” that the company develops as an MVP).

In this LCAS, the user uploads a DXF containing CRVs in different LAYERs, and goes through a process of optimizing, includes Nesting, Line-Type options, Deleting Duplicate CRVs, Flattening 3D CRVs, and more…

On my computer the system:

  • Works perfectly.
  • Uses only permitted components for SD.

I’d love to know why I get the following opinion when I bring up the setting:
Not a Grasshopper file
(Ref: 59be5154-2642-4b3d-bded-b894d62cc043)

Attached:

Thanks!

Thank you!

I am not sure why the servers give you this error at the moment, but when I try to open your file in Rhino 6, it tells me that you are using a component from Kangaroo 1 (removeDuplicateLines). We only support Kangaroo 2 on the shared system, therefore you should switch to the Kangaroo 2 version of removeDuplicateLines (it’s identical).

Let me know if you can upload your file after that change.

Hi Mathieu,

Thanks so much for your reply, I found one instance of the “removeDuplicateLines” component in each of my deffenitions, here:


(In each deffenition - once: PC + SD, wich are basickly the same GH deffenitions - one for PC and one for SD…).

  • Attached the new 2 GH deffenitions with this one correction (PC+SD):
    LCAS for PC - 2.gh (401.5 KB) LCAS for SD - 2.gh (400.0 KB)
  • Here’s the definition - SD vertion, in the SD interface, for your review:
    Not a Grasshopper file
    (Ref: 4e79cec0-d036-4aa1-9e15-d9208a5bb159)

Thanks!

Hi Mathieu,

I’m really waiting for your answer.

Thanks!

This one was difficult to track, sorry for the delay. It turns out that your model contains an empty VB script (a script component with no code in it). It is in the part of the definition that I emphasize below:

Our system currently denies models with empty scripts, this is a problem we know and will fix soon. But for now, your model should work if you remove this empty script component. I tested it and could upload the file without issue.

However, there are two additional points you should be careful with:

  1. You cannot connect a geometry component as input of the ShapeDiverGeometryInput. This is what you are doing here:

    This input expects either the URL string of a file stored online, or a local file path (which obviously should be used only for testing and be removed before uploading the file).
  2. Your model contains more than 50 VB script components which all perform a simple logical operation. This is allowed, but note that this will impact the performance of your model. You can easily reproduce this behaviour with native GH components (components from the Maths > Operators category as well as the Stream Filter).

Hi Mathieu,

Thank you for your Comprehensive reply,

Empty VB:
I found in the area you marked in the definition 3 VBs, and they all contain a valid code:


I would love to understand what component you meant.

  1. If so - I left the ShapeDiverGeometryInput INPUT blank. (Corrected in the attached definition):


    Is it OK?

  2. Thanks for that advice:
    2.1. I deleted a large amount of VBs from the definition. (Corrected in the attached definition)
    2.2. Of course as soon as I see that it works - I will try to shorten and improve the definition before any real contact with consumers …
    2.3. To understand - Is it true to say that using “native GH components” always gives better performance than VBs? even in case one VB can save a number of “native GH components” (Reduces the total amount of components in the definition)?

The definition still doesn’t work on SD interface - after the fixes
(Other than the empty VB that I didn’t find …)
(Ref: 4269af01-3a7d-41ec-8cea-68eab1b89e90)

Thank you!

Here is a screenshot of what I see when I open both of the definitions you posted in your previous message. I circled in red the empty VB script.

I think we should agree to leave this as an unsolved mystery and move on. As a matter of fact, we have already updated the backend to automatically validate empty scripts so it will not be an issue in the future.

2.3 It is sometimes necessary and/or optimal to use a script, but if you have multiple scripts doing simple operations, it is an unnecessary burden because the scripts have to be compiled and make the definition heavier.

Your latest definition has an issue that I could not yet identify. I tried to upload it several times and it worked about half the times, and failed otherwise. I encourage you to try uploading it again and see if you can move forward while we try to figure out what the problem is. In general, getting rid of unused components should help us identify the issue.

Hey Mathieu, Thanks for your reply,

I arranged the definition better so that it is divided into stages By groups (red and orange).
I brought it up and I would love for you to check it out:
Message: “Your model contains scripts that need to be checked”
Ref: 455228fb-bfda-4ffb-ac3d-4ab839f874b5

The steps in the definition are as follows:

@ Step # 1 - (at beginning and end of code = orange)

  • Switch from “PC mode” to “SD mode”

@ Step # 2 - FLATTEN

  • What to do with 3D CRVs?
    • Flatten
    • Delete

@ Step 3 # - OVERKILL (not required, has default mode)

  • Change the way you delete overlaped CRVs, in order of layer prioritization
    • REC = 1/2/3/4
    • CUT1 = 1/2/3/4
    • CUT2 = 1/2/3/4
    • MARK = 1/2/3/4
  • Associating CRVs from other layers (OTHER) to…
    • REC
    • CUT1
    • CUT2
    • MARK

@ Step 4 # - REC or NEST?

  • Dimensions of the material
    • X dim = ?
    • Y dim = ?
  • Use REC or Nest CRVs?
    • REC
    • NEST

@ Step # 5 - NEST properties (not required, have default mode)

  • More Iterations?
  • More Cartbords?
  • Desstance btween peaces = ?
  • What to do with MARK layer
    • use for marking
    • use for cutting
    • delete
  • use CUT1 in CUT2 or use CUT1 separately
    • use CUT1 inside CUT2
    • use CUT1 & CUT2 seperatly

@ Step # 6 - LineType & Nombering (not required, has default mode)

  • LineType for eatch layer
    • CUT1 (line+gap length)
    • CUT2 (line+gap length)
    • MARK (line+gap length)
  • Two numbering methods:
    • Numeric
    • Roman
    • Font size = ?

Attached files for checking the system on the PC if necessary:

Waiting for your update,

Thank you!

Hi Mathieu,

I’m really waiting for your answer.

Thanks!

I am not sure what the problem is. When you get the “Your model contains scripts that need to be checked”, it just means that we will review the scripts in your model and make sure they are allowed on the servers. In your case, the model only contains very simple scripts which should be allowed. It is possible that we missed one, in that case my apologies. If you try to upload the model again, we should be able to validate the rest of the scripts. However, here are a few pieces of advice:

  1. All of the VB scripts you use in your model are unnecessary. You use them for computing simple expressions, for which you can use components from the “Maths” category, mainly the logical operators and the expression component. For example, you have a script that computes the following expression:

if x * 3 + y * 3 < z then A = x else A = ( z - y * 3 ) / 3

This can be replaced by the following “Expression” component:

There are two advantages of doing that: first, you will not need us to manually validated your script. Second, your model will perform better because the servers won’t need to compile the script.

  1. Do you know that you can double-click on the “ShapeDiverTextInput” component and set a default value for the text? That would save you from having to change your connections every time you upload the file.

  2. If your model does not output any geometry by default, you will get an error message from the servers. Make sure you always display something, even if it is dummy geometry, so that you can pass the model check.

Let me know if that information helps.