Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

26
LINES

< > BotCompany Repo | #1034415 // OnePathWithOrigin - OnePath plus starting position

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (8853L/49K).

1  
sclass OnePathWithOrigin > OnePath {
2  
  settable Pt origin = pt(0, 0);
3  
  
4  
  *() {}
5  
  *(S path) { super(path); }
6  
  *(Pt *origin, S path) { super(path); }
7  
  *(int originX, int originY, S path) { super(path); origin = pt(originX, originY); }
8  
  *(Iterable<Pt> points, bool close) {
9  
    var l = asList(points);
10  
    origin = first(l);
11  
    fromPoints(l, close);
12  
  }
13  
  
14  
  *(OnePathWithOrigin path) {
15  
    super(path);
16  
    origin = path.origin;
17  
  }
18  
  
19  
  toString {
20  
    ret "Origin (" + origin + "), path: " + super.toString();
21  
  }
22  
  
23  
  OnePathWithOrigin reversed() {
24  
    ret new OnePathWithOrigin(reversedList(pointList()), false);
25  
  }
26  
}

Author comment

Began life as a copy of #1034075

download  show line numbers  debug dex  old transpilations   

Travelled to 4 computer(s): bhatertpkbcr, ekrmjmnbrukm, mowyntqkapby, mqqgnosmbjvj

No comments. add comment

Snippet ID: #1034415
Snippet name: OnePathWithOrigin - OnePath plus starting position
Eternal ID of this version: #1034415/11
Text MD5: 80afb4c8abaed22f63e69f016d8aa4fa
Transpilation MD5: 299d9851b8ba2d75b399687dff59f109
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-05-06 20:05:10
Source code size: 651 bytes / 26 lines
Pitched / IR pitched: No / No
Views / Downloads: 181 / 355
Version history: 10 change(s)
Referenced in: [show references]