deepmind-research icon indicating copy to clipboard operation
deepmind-research copied to clipboard

CAD sketches for Computer-Aided Design as Language : missing constraint reference to entity relationship

Open yyuezhi opened this issue 3 years ago • 1 comments

Hi, I try to explore the dataset used by used in "Computer-Aided Design as Language", but I have problem in finding which entities each constraints refer to. For example, I try to retrieve the first sketch from the training split and I get the following entities and constraints:

entity_sequence {
  entities {
    line_entity {
      start {
        x: -0.9999989999620049
        y: 0.14356660975133936
      }
      end {
        x: -0.10311290613999784
        y: 0.14356660975133936
      }
    }
  }
  entities {
    line_entity {
      start {
        x: -0.10311290613999806
        y: 0.14356660975133936
      }
      end {
        x: -0.10311290613999806
        y: 0.020326325688445626
      }
    }
  }...}

constraint_sequence {
  constraints {
    coincident_constraint {
      entities: 4
      entities: 2
    }
  }
  constraints {
    coincident_constraint {
      entities: 15
      entities: 13
    }
  }
  constraints {
    coincident_constraint {
      entities: 18
      entities: 16
    }
  }...}

I wonder how these "entities" field in constrint corresponds to entities defined in above. For example, how the entities 2 and 4 in the first constraints corresponds to entities. I suspect these numbers refer to the index of entities or part of entities defined above, but in what way? Is there a reliable way to find out which entities/parts these constraints refer to?

yyuezhi avatar Aug 17 '22 10:08 yyuezhi

Hi,

Indeed, those entities refer to object parts that follow a specific layout:

entity0.part0, entity0.part1, ..., entity0.partN, entity1.part0, entity1.part1, ...

Try following layouts for different entity types:

Entity type                | Parts
---------------------------+----------------------------------------------------------------------------------------------------
point_entity               | entity
interpolated_spline_entity | entity, interp_point0, ..., interp_pointM, start_derivative, end_derivative, start_point, end_point
circle_arc_entity          | entity, center, [start_point, end_point] (if not closed)
line_entity                | entity, start_point, end_point

Hope this helps

ddtm avatar Aug 17 '22 15:08 ddtm