iorodeo avatar iorodeo committed 5237095

Project creation.

Comments (0)

Files changed (13)

+syntax: glob
+*.pyc
+*~
+*.o
+*.egg-info
+*.swp
+*.scad
+*.stl
+py2scad installation instructions
+=================================
+
+Requirements:
+
+  * scipy (not really sure which versions will work - a reasonbly recent one should do)
+  * OpenSCAD (only required to view your parts, translate them the stl files, etc.)
+
+Installation:
+
+The package uses the Python setuptools, you can build it by calling
+
+python setup.py install
+
+which installs the package on your system.  See the "Installing Python
+Modules" manual inside your Python documentation or at
+http://docs.python.org/inst/inst.html if you want to customize the
+build process or the target location.
+
+
+
+
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
+
+
+py2scad: Create OpenSCAD 3D solid models using python
+
+Do you prefer programming to drawing? Do you want a simple way to create
+complicated 3D solid models using your favorite programing language? If so then
+py2sacd may just be the thing for you. py2scad is a simple python library which
+enables you write .scad files using python. py2scad is meant to be used in
+conjuction with Clifford Wolff's great OpenSCAD program (http://openscad.org/).
+Use py2scad to create the .scad version of your part and OpenSCAD to view your
+part as you create it. 
+
+Installations instructions can be found in the INSTALL file.
+
+Author: Will Dickson IO Rodeo Inc. 
+
+py2scad may be freely distributed and modified in accordence with the Apache
+2.0  License.
+
+from base import SCAD_Prog
+from primatives import *
+from transforms import * 
+from highlevel import *
+import scipy
+
+if 1:
+
+    c = Circle(r=2.0)
+    s = Square(size=[3,1])
+    p = Polygon(points=[[0,0],[1,0],[1,1]], paths=[[0,1,2]])
+    p.write('test.scad',fn=100)
+    print p
+    print c
+
+if 1:
+
+    c = Circle(r=1.0)
+    c = Translate(c,v=[2,0,0])
+    torus = Rotate_Extrude(c)
+    torus.write('test.scad')
+    print torus
+
+if 1:
+
+    x = scipy.linspace(0,8,500)
+
+    points1 = []
+    points2 = []
+    for xx in x:
+        y = scipy.cos(2.0*scipy.pi*xx)+0.3*scipy.cos(4.0*scipy.pi*xx) + 0.25
+        points1.append([5.0*xx,y])
+    for xx in x:
+        y = scipy.cos(2.0*scipy.pi*xx)+0.3*scipy.cos(4.0*scipy.pi*xx) - 0.25 
+        points2.append([5.0*xx,y])
+
+    points2.reverse()
+    points = points1 + points2
+
+    paths = [range(0,len(points))]
+    poly = Polygon(points, paths)
+    part = Linear_Extrude(poly,h=40.0)
+    c = Cylinder(h=5,r1=20,r2=20,mod='')
+    c = Rotate(c,a=90,v=[1,0,0])
+    c = Translate(c,v=[20,0,0])
+    c2 = Cylinder(h=5,r1=2,r2=2,mod='')
+    c2 = Rotate(c2,a=90,v=[1,0,0])
+    c2 = Translate(c2,v=[20,0,0])
+    part = Intersection([part,c])
+    part = Difference([part,c2])
+    prog = SCAD_Prog()
+    prog.add(part)
+    prog.fn = 50
+    print prog
+    prog.write('test.scad')
+
+
+
+if 1:
+    import math
+    DEG2RAD = math.pi/180.0
+
+    length = 11.0
+    width = 5.0
+    height = 0.5
+    hole_diam = 0.1
+    pat_radius = 0.4
+
+    holes = []
+    for x_shift in [-4.5, -3.0,-1.5, 0,1.5,3.0, 4.5]:
+        for y_shift in [-1.5,0, 1.5]:
+            for ang in range(0,360,60):
+                x = pat_radius*math.cos(DEG2RAD*ang) + x_shift
+                y = pat_radius*math.sin(DEG2RAD*ang) + y_shift
+                holes.append((x,y,hole_diam))
+
+    plate = plate_w_holes(length,width,height,holes,hole_mod='')
+
+    prog = SCAD_Prog()
+    prog.add(plate)
+    prog.fn=50
+    prog.write('test.scad')
+    print prog
+
+if 1:
+
+    c1 = Cylinder(h=0.5, r1=3.5, r2=3.5) 
+    c3 = Cylinder(h=1.0, r1=2.6, r2=2.6)
+    c1 = Difference([c1,c3])
+    c2 = Cylinder(h=0.75, r1=1.5, r2=1.6)
+    c2 = Translate(c2,v=[0,0,-4.5],mod='')
+    c4 = Cylinder(h=0.75,r1=5.5,r2=5.5)
+    c4 = Translate(c4,v=[0,0,4.5],mod='')
+    c5 = Cylinder(h=1.0, r1=4.5, r2=4.5)
+    c5 = Translate(c5,v=[0,0,4.5])
+    c4 = Difference([c4,c5])
+    h = Cylinder(h=10,r1=0.1,r2=0.1)
+    h = Rotate(h,a=25,v=[0,1,0])
+    h = Translate(h,v=[3,0,0])
+    hr_list = []
+    for ang in range(0,360,20):
+        hr = Rotate(h,a=ang,v=[0,0,1],mod='%') 
+        hr_list.append(hr)
+
+    obj_list1 = [c1] + hr_list
+    part1 = Difference(obj_list1)
+    obj_list2 = [c2] + hr_list
+    part2 = Difference(obj_list2)
+    obj_list3 = [c4] + hr_list
+    part3 = Difference(obj_list3)
+
+    prog = SCAD_Prog()
+    prog.add(part1)
+    prog.add(part2)
+    prog.add(part3)
+    prog.fn=50
+    prog.write('test.scad')
+    print prog
+
+
+if 1:
+
+    model = Import_STL('test.stl')
+    hole = Cylinder(h=10,r1=2,r2=2)
+    hole = Translate(hole,v=[0,7,0],mod='')
+    model = Difference([model,hole])
+
+    prog = SCAD_Prog()
+    prog.add(model)
+    prog.fn=50
+    prog.write('test.scad')
+
+if 1:
+
+    prog = SCAD_Prog()
+    p = Cube(size=[15,15,1])
+    p = Color(p,rgba=[0.5,0.5,0.5,0.5])
+    c = Cylinder(h=5,r1=2,r2=1)
+    c = Color(c,rgba=[0,1,0,0.1])
+    s = Sphere(r=1)
+    s = Color(s,rgba=[1,0,0,0.05])
+    p = AnimRotate(p,a='$t*360.0',v=[1.0,0.0,0.0])
+    c = AnimTranslate(c,v='[0.0,0.0,10.0*cos($t*360)]')
+    s = AnimTranslate(s,v='[20*cos($t*360),10*sin($t*360*2),0]')
+
+    prog.add(p)
+    prog.add(c)
+    prog.add(s)
+    prog.fn=50
+    prog.write('test.scad')
+
+        
+if 1:
+    prog = SCAD_Prog()
+    box = rounded_box(20,20,10,2.0)
+    test = Cube(size=[20,20,10],mod='%')
+    prog.add(box)
+    prog.add(test)
+    prog.fn=30
+    prog.write('test.scad')
+
+if 1:
+    prog = SCAD_Prog()
+    box = rounded_box(10,10,5,2.5)
+    cube = rounded_box(20,20,5,0.5)
+    box = Translate(box,v=[0,0,2.5])
+    part = Difference([cube,box])
+    prog.add(part)
+    prog.fn=50
+    prog.write('test.scad')
+
+
+if 1:
+    prog = SCAD_Prog()
+    points = [[0,0,0],[1,0,0],[1,1,0],[0,1,0],[0,0,1],[1,0,1],[1,1,1],[0,1,1]]
+    
+    faces = [[0,1,2,3],[7,6,5,4],[4,5,1,0],[5,6,2,1],[2,6,7,3],[0,3,7,4]]
+    p = Polyhedron(points = points, faces = faces)
+    p = Translate(p,v=[-0.5,-0.5,-0.5])
+    prog.add(p)
+    prog.fn=20
+    prog.write('test.scad')
+
+if 1:
+    
+    def sqr(x,y):
+        return x**2 + y**2
+    def gaussian(x,y):
+        return scipy.exp(-(x**2+y**2)/1.0)
+
+    prog = SCAD_Prog()
+    #box = grid_box(1,1,0.1,30,30,top_func=sqr,bot_func=sqr)
+    box = grid_box(5,5,0.1,50,50,top_func=gaussian,bot_func=gaussian)
+    #box = grid_box(1,1,0.4,2,2,xy_func=None)
+    cyl = Cylinder(h=4,r1=0.2,r2=0.2)
+    part = Difference([box,cyl])
+    #prog.add(box)
+    #prog.add(cyl)
+    prog.add(part)
+    prog.fn=20
+    prog.write('test.scad')
+
+if 1:
+
+    prog = SCAD_Prog()
+    c = Circle(r=0.25)
+    c = Translate(c,v=[2,0,0])
+    torus = Rotate_Extrude(c)
+    cut = wedge_cut(torus,145,270,4,2,mod='')
+    prog.add(cut)
+    prog.fn=30
+    prog.write('test.scad')
+
+if 1:
+    prog = SCAD_Prog()
+    p = partial_cylinder(5,1,2,90.0,360.0,mod='')
+    prog.fn=40
+    prog.add(p)
+    prog.write('test.scad')
+
+if 1:
+    prog = SCAD_Prog()
+    p = ellipse_edged_disk(1,5,edge_scale=1.5)
+    prog.fn=40
+    prog.add(p)
+    prog.write('test.scad')
+
+

examples/view_stl.py

+#!/usr/bin/env python
+#
+# view_stl.py - A simple vtk based stl file viewer
+#
+# Author: William Dickson 12/21/04
+#
+# --------------------------------------------------------------
+import vtk, sys
+
+stlfile = sys.argv[1]
+# Create the reader and read a data file.  
+sr = vtk.vtkSTLReader()
+sr.SetFileName(stlfile)
+
+# Connect the mapper and actor 
+stlMapper = vtk.vtkPolyDataMapper()
+stlMapper.SetInput(sr.GetOutput())
+stlActor = vtk.vtkLODActor()
+stlActor.SetMapper(stlMapper)
+
+# Create the Renderer, RenderWindow, and RenderWindowInteractor
+ren = vtk.vtkRenderer()
+renWin = vtk.vtkRenderWindow()
+renWin.AddRenderer(ren)
+iren = vtk.vtkRenderWindowInteractor()
+iren.SetRenderWindow(renWin)
+
+# Add the actors to the render; set the background and size
+ren.AddActor(stlActor)
+ren.SetBackground(0.1, 0.2, 0.4)
+renWin.SetSize(600, 600)
+
+# Render
+iren.Initialize()
+ren.ResetCameraClippingRange()
+renWin.Render()
+iren.Start()

py2scad/__init__.py

+"""
+Copyright 2010  IO Rodeo Inc. 
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+"""
+from primatives import *
+from transforms import *
+from highlevel import *
+ 
+"""
+Copyright 2010  IO Rodeo Inc. 
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+"""
+from utility import TAB_WIDTH
+
+class SCAD_Prog(object):
+
+    def __init__(self,objlist = [],fn=None,fa=None,fs=None):
+        self.objlist = objlist 
+        self.fn = fn
+        self.fa = fa
+        self.fs = fs
+
+    def add(self,obj):
+        if type(obj) == list:
+            self.objlist.extend(obj)
+        else:
+            self.objlist.append(obj)
+
+    def __str__(self):
+        rtn_str = ''
+        if not self.fn == None:
+            rtn_str = '%s$fn = %d;\n'%(rtn_str,self.fn)
+        if not self.fa == None:
+            rtn_str = '%s$fa = %d;\n'%(rtn_str,self.fa)
+        if not self.fs == None:
+            rtn_str = '%s$fs = %d;\n'%(rtn_str,self.fs)
+
+        for obj in self.objlist:
+            rtn_str = '%s%s\n'%(rtn_str,obj)
+
+        return rtn_str
+
+    def write(self,filename):
+        fid = open(filename,'w')
+        fid.write(get_header_str(filename))
+        fid.write('%s'%(self,))
+        fid.close()
+
+class SCAD_Object(object):
+
+    def __init__(self,center=True,mod=''):
+        self.type = None
+        self.center = center
+        self.cmp = False
+        self.mod = mod
+
+    def center_str(self):
+        return str(self.center).lower()
+
+    def is_cmp(self):
+        return self.cmp
+
+    def cmd_str(self,tab_level=0):
+        return 'Empty SCAD_Object'
+
+    def __str__(self,tab_level=0):
+        tab_str = ' '*TAB_WIDTH*tab_level
+        mod_str = self.mod
+        return '%s%s%s'%(tab_str, mod_str, self.cmd_str(tab_level=tab_level))
+
+    def write(self,filename,fn=None):
+        fid = open(filename,'w')
+        if not fn == None:
+            fid.write('$fn=%d;\n'%(fn,))
+        fid.write('%s'%(self,))
+        fid.close()
+
+class SCAD_CMP_Object(SCAD_Object):
+
+    def __init__(self,obj,center=True,mod=''):
+        SCAD_Object.__init__(self,center=center,mod=mod)
+        self.cmp = True 
+        #self.obj = obj
+        if type(obj) == list:
+            self.obj = obj 
+        else:
+            self.obj = [obj]
+
+    def cmd_str(self,tab_level=0):
+        return 'Empty SCAD_CMP_Object'
+
+    def __str__(self, tab_level=0):
+        tab_str = ' '*TAB_WIDTH*tab_level
+        mod_str = self.mod
+        rtn_str = '%s%s%s'%(tab_str, mod_str, self.cmd_str())
+        rtn_str = '%s {\n'%(rtn_str,)
+        for obj in self.obj:
+            rtn_str = '%s%s\n'%(rtn_str,obj.__str__(tab_level=tab_level+1))
+        rtn_str = '%s%s}'%(rtn_str,tab_str,)
+
+        return rtn_str
+
+def get_header_str(filename):
+    str0 = '//' + '='*70 + '\n'
+    str1 = '// %s\n'%(filename,)
+    str2 = """//
+// Autogenerated using py-scad. Hand editing this file is not advisable 
+// as all modifications will be lost when the program which generated 
+// this file is re-run. 
+// 
+"""
+    return str0 + str1 + str2 + str0 + '\n'

py2scad/highlevel.py

+"""
+Copyright 2010  IO Rodeo Inc. 
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+"""
+import scipy
+from primatives import *
+from transforms import *
+from utility import DEG2RAD
+from utility import RAD2DEG
+
+def rounded_box(length,width,height,radius,round_x=True,round_y=True,round_z=True):
+    """
+    Create a box with rounded corners
+    """
+    assert round_x or round_y == True, 'x and y faces not rounded - at least two sides must be rounded'
+    assert round_x or round_z == True, 'x and z faces not rounded - at least two faces must be rounded'
+    assert round_y or round_z == True, 'y and z faces not rounded - at least two faces must be rounded'
+
+    if round_x == True:
+        dx = length - 2.0*radius
+    else:
+        dx = length
+    if round_y == True:
+        dy = width - 2.0*radius
+    else:
+        dy = width
+    if round_z == True:
+        dz = height - 2.0*radius
+    else:
+        dz = height
+    union_list = []
+
+    inner_box = Cube([dx,dy,dz])
+    union_list.append(inner_box)
+
+    if round_x==True:
+        xface_box = Cube([2*radius,dy,dz])
+        xface_box0 = Translate(xface_box,v=[0.5*dx,0,0])
+        xface_box1 = Translate(xface_box,v=[-0.5*dx,0,0])
+        union_list.extend([xface_box0, xface_box1])
+
+    if round_y==True:
+        yface_box = Cube([dx,2*radius,dz])
+        yface_box0 = Translate(yface_box,v=[0, 0.5*dy,0])
+        yface_box1 = Translate(yface_box,v=[0, -0.5*dy,0])
+        union_list.extend([yface_box0, yface_box1])
+
+    if round_z==True:
+        zface_box = Cube([dx,dy,2*radius])
+        zface_box0 = Translate(zface_box,v=[0, 0, 0.5*dz])
+        zface_box1 = Translate(zface_box,v=[0, 0, -0.5*dz])
+        union_list.extend([zface_box0, zface_box1])
+
+    xaxis_cly = Cylinder(h=dx,r1=radius,r2=radius)
+    xaxis_cly = Rotate(xaxis_cly,a=90,v=[0,1,0])
+    yaxis_cly = Cylinder(h=dy,r1=radius,r2=radius)
+    yaxis_cly = Rotate(yaxis_cly,a=90,v=[1,0,0])
+    zaxis_cly = Cylinder(h=dz,r1=radius,r2=radius)
+
+    for i in [-1,1]:
+        for j in [-1,1]:
+            if round_y==True and round_z==True:
+                temp_cyl = Translate(xaxis_cly,v=[0,i*0.5*dy,j*0.5*dz])
+                union_list.append(temp_cyl)
+            if round_z==True and round_x==True:
+                temp_cyl = Translate(yaxis_cly,v=[i*0.5*dx,0,j*0.5*dz])
+                union_list.append(temp_cyl)
+            if round_x==True and round_y==True:
+                temp_cyl = Translate(zaxis_cly,v=[i*0.5*dx,j*0.5*dy,0])
+                union_list.append(temp_cyl)
+
+    if round_x==True and round_y==True and round_z==True:
+        corner_sph = Sphere(r=radius)
+        for i in [-1,1]:
+            for j in [-1,1]:
+                for k in [-1,1]:
+                    temp_sph = Translate(corner_sph,v=[i*0.5*dx,j*0.5*dy,k*0.5*dz])
+                    union_list.append(temp_sph)
+
+    box = Union(union_list)
+    return box
+
+def plate_w_holes(length, width, height, holes=[], hole_mod='', radius=False):
+    """
+    Create a plate with holes in it.
+    
+    Arguments:
+      length = x dimension of plate
+      width  = y dimension of plate
+      height = z dimension of plate
+      holes  = list of tuples giving x position, y position and diameter of 
+               holes
+    """
+    if radius == False:
+        plate = Cube(size=[length,width,height])
+    else:
+        plate = rounded_box(length,width,height,radius)
+    cylinders = []
+    for x,y,r in holes:
+        c = Cylinder(h=4*height,r1=0.5*r, r2=0.5*r)
+        c = Translate(c,v=[x,y,0],mod=hole_mod)
+        cylinders.append(c)
+    obj_list = [plate] + cylinders
+    plate = Difference(obj_list)
+    return plate
+
+def grid_box(length, width, height, num_length, num_width,top_func=None,bot_func=None):
+    """
+    Create a box with given length, width, and height. The top and bottom surface of the
+    box will be triangulate bases on a grid with num_length and num_width points. 
+    Optional functions top_func and bot_func can be given to distort the top or bottom
+    surfaces of the box. 
+    """
+    nl = num_length + 1
+    nw = num_width + 1
+    xpts = scipy.linspace(-0.5*length,0.5*length,nl)
+    ypts = scipy.linspace(-0.5*width,0.5*width,nw)
+
+    points_top = []
+    points_bot = []
+    for y in ypts:
+        for x in xpts:
+            if top_func == None:
+                zval_top = 0.0
+            else:
+                zval_top = top_func(x,y)
+            if bot_func == None:
+                zval_bot = 0.0
+            else:
+                zval_bot = bot_func(x,y)
+            points_top.append([x,y,0.5*height+zval_top])
+            points_bot.append([x,y,-0.5*height+zval_bot])
+
+    faces_top = []
+    faces_bot = []
+    numtop = len(points_top)
+    for i in range(0,nl-1):
+        for j in range(0,nw-1):
+            # Top triangles
+            f = [(j+1)*nl+i, (j+1)*nl+i+1, j*nl+i+1]
+            faces_top.append(f)
+            f = [(j+1)*nl+i, j*nl+i+1, j*nl+i]
+            faces_top.append(f)
+            # Botton triangles
+            f = [numtop+j*nl+i+1, numtop+(j+1)*nl+i+1, numtop+(j+1)*nl+i]
+            faces_bot.append(f)
+            f = [numtop+j*nl+i, numtop+j*nl+i+1,  numtop+(j+1)*nl+i]
+            faces_bot.append(f)
+
+    faces_front = []
+    faces_back = []
+    for i in range(0,nl-1):
+        # Front triangles
+        f = [i+1,numtop+i+1,numtop+i]
+        faces_front.append(f)
+        f = [i,i+1,numtop+i]
+        faces_front.append(f)
+        # Back triangles
+        f = [2*numtop-nl+i+1,numtop-nl+i+1,numtop-nl+i]
+        faces_back.append(f)
+        f = [2*numtop-nl+i,2*numtop-nl+i+1,numtop-nl+i]
+        faces_back.append(f)
+
+
+    faces_right = []
+    faces_left = []
+    for j in range(0,nw-1):
+        # Right triangles
+        f = [nl-1 +(j+1)*nl,numtop+nl-1+(j+1)*nl,numtop+nl-1+j*nl]
+        faces_right.append(f)
+        f = [nl-1 + j*nl,nl-1 +(j+1)*nl,numtop+nl-1+j*nl]
+        faces_right.append(f)
+        # Left triangles
+        f = [numtop+(j+1)*nl,(j+1)*nl,j*nl]
+        faces_left.append(f)
+        f = [numtop+j*nl,numtop+(j+1)*nl,j*nl]
+        faces_left.append(f)
+
+    points = points_top + points_bot
+    faces = faces_top + faces_bot 
+    faces.extend(faces_front) 
+    faces.extend(faces_back)
+    faces.extend(faces_right)
+    faces.extend(faces_left)
+
+    p = Polyhedron(points=points,faces=faces)
+    return p
+
+def wedge_cut(obj,ang0,ang1,r,h,numpts=20,mod=''):
+    """
+    Cut out a wedge from obj from ang0 to ang1 with given radius r
+    and height h. 
+    """
+    ang0rad = DEG2RAD*ang0
+    ang1rad = DEG2RAD*ang1
+    angs = scipy.linspace(ang0rad,ang1rad,numpts)
+    points_arc = [[r*scipy.cos(a),r*scipy.sin(a)] for a in angs]
+    points = [[0,0]]
+    points.extend(points_arc)
+    paths = [range(0,len(points))]
+    poly = Polygon(points=points, paths=paths)
+    cut = Linear_Extrude(poly,h=h,mod=mod)
+    cut_obj = Difference([obj,cut])
+    return cut_obj
+
+def partial_cylinder(h,r1,r2,ang0,ang1,cut_extra=1.0,mod=''):
+    """
+    Create a partial cylinder with given height h, start and end
+    radii r1 and r2, from angle ang0 t0 angle ang1.
+    """
+    cut_ang0 = ang1
+    cut_ang1 = ang0 + 360.0
+    cyl = Cylinder(h=h,r1=r1,r2=r2)
+    cut_r = max([r1,r2]) + cut_extra 
+    cut_h = h + cut_extra 
+    cut_cyl = wedge_cut(cyl,cut_ang0,cut_ang1,cut_r,cut_h,mod=mod)
+    return cut_cyl
+
+def ellipse_edged_disk(h,r,edge_scale=1.0):
+    """
+    Create a disk with an ellipse around the edge
+    """
+    assert edge_scale <= r, 'edge_scale must be <= disk radius'
+    edge_len = 0.5*h*edge_scale
+    disk = Cylinder(h=h,r1=r-edge_len,r2=r-edge_len)
+    c = Circle(r=0.5*h)
+    c = Scale(c,v=[edge_scale,1.0,1.0])
+    c = Translate(c,v=[r-edge_len,0,0])
+    torus = Rotate_Extrude(c)
+    disk = Union([disk,torus])
+    return disk 
+
+def rounded_disk(h,r,edge_r):
+    pass
+
+
+
+    
+
+
+
+
+

py2scad/primatives.py

+"""
+Copyright 2010  IO Rodeo Inc. 
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+"""
+import base
+import utility
+
+# 3D primitives ---------------------------------------------------------------
+
+class Cube(base.SCAD_Object):
+
+    def __init__(self, size=1.0, center=True, mod=''):
+        base.SCAD_Object.__init__(self,center=center,mod=mod)
+        try:
+            self.size = float(size)
+        except:
+            self.size = utility.float_list3(size)
+
+    def cmd_str(self,tab_level=0):
+        size_str = utility.val_to_str(self.size)
+        center_str = self.center_str()
+        return 'cube(size=%s,center=%s);'%(size_str,center_str) 
+
+class Sphere(base.SCAD_Object):
+
+    def __init__(self, r=1.0, center=True,mod=''):
+        base.SCAD_Object.__init__(self,center=center,mod=mod)
+        self.r = float(r)
+
+    def cmd_str(self,tab_level=0):
+        r_str = utility.val_to_str(self.r)
+        center_str = self.center_str()
+        return 'sphere(r=%s,center=%s);'%(r_str, center_str)
+
+class Cylinder(base.SCAD_Object):
+
+    def __init__(self, h=1.0, r1=1.0, r2=1.0, center=True,mod=''):
+        base.SCAD_Object.__init__(self,center=center,mod=mod)
+        self.h = float(h)
+        self.r1 = float(r1)
+        self.r2 = float(r2)
+
+    def cmd_str(self,tab_level=0):
+        h_str = utility.val_to_str(self.h)
+        r1_str = utility.val_to_str(self.r1)
+        r2_str = utility.val_to_str(self.r2)
+        center_str = self.center_str()
+        return 'cylinder(h=%s,r1=%s,r2=%s,center=%s);'%(h_str, r1_str, r2_str, center_str)
+        
+class Polyhedron(base.SCAD_Object):
+
+    def __init__(self, points, faces, center=True, mod=''):
+        base.SCAD_Object.__init__(self,center=center,mod=mod)
+        self.points = [utility.float_list3(x) for x in points]
+        self.faces = [utility.float_list(x) for x in faces]
+
+    def cmd_str(self,tab_level=0):
+        tab_str0 = ' '*utility.TAB_WIDTH*tab_level
+        tab_str1 = ' '*utility.TAB_WIDTH*(tab_level+1)
+        rtn_str = 'polyhedron(\n'
+        rtn_str = '%s%spoints = [\n'%(rtn_str,tab_str1,)
+        for p in self.points:
+            p_str = utility.val_to_str(p,tab_level=tab_level+2)
+            rtn_str = '%s%s,\n'%(rtn_str,p_str)
+        rtn_str = '%s%s],\n'%(rtn_str,tab_str1,)
+        rtn_str = '%s%striangles = [\n'%(rtn_str,tab_str1,)
+        for p in self.faces:
+            p_str = utility.val_to_str(p,tab_level=tab_level+2)
+            rtn_str = '%s%s,\n'%(rtn_str,p_str)
+        rtn_str = '%s%s]\n'%(rtn_str,tab_str1,)
+        rtn_str = '%s%s);\n'%(rtn_str,tab_str0)
+        return rtn_str
+
+class Import_STL(base.SCAD_Object):
+
+    def __init__(self, filename, convexity=5,mod=''):
+        base.SCAD_Object.__init__(self,mod=mod)
+        self.filename = filename
+        self.convexity = convexity
+
+    def cmd_str(self,tab_level=0):
+        return 'import_stl("%s",convexity=%d);'%(self.filename,self.convexity)
+
+# 2D primatives ---------------------------------------------------------------
+
+class Circle(base.SCAD_Object):
+
+    def __init__(self,r=1,mod=''):
+        base.SCAD_Object.__init__(self,mod=mod)
+        self.r = float(r)
+
+    def cmd_str(self,tab_level=0):
+        r_str = utility.val_to_str(self.r)
+        rtn_str = 'circle(r=%s);'%(r_str,)
+        return rtn_str
+
+class Square(base.SCAD_Object):
+
+    def __init__(self,size=[1,1],center=True, mod=''):
+        base.SCAD_Object.__init__(self,center=center,mod=mod)
+        self.size = utility.float_list2(size)
+
+    def cmd_str(self,tab_level=0):
+        size_str = utility.val_to_str(self.size)
+        center_str = self.center_str()
+        return 'square(size=%s,center=%s);'%(size_str,center_str)
+
+class Polygon(base.SCAD_Object):
+
+    def __init__(self,points,paths,mod=''):
+        base.SCAD_Object.__init__(self,mod=mod)
+        self.points = [utility.float_list2(p) for p in points]
+        self.paths = [utility.float_list(p) for p in paths]
+
+    def cmd_str(self,tab_level=0):
+        tab_str0 = ' '*utility.TAB_WIDTH*tab_level
+        tab_str1 = ' '*utility.TAB_WIDTH*(tab_level+1)
+        rtn_str = 'polygon(\n'
+        rtn_str = '%s%spoints = [\n'%(rtn_str,tab_str1,)
+        for p in self.points:
+            p_str = utility.val_to_str(p,tab_level=tab_level+2)
+            rtn_str = '%s%s,\n'%(rtn_str,p_str)
+        rtn_str = '%s%s],\n'%(rtn_str,tab_str1,)
+        rtn_str = '%s%spaths = [\n'%(rtn_str,tab_str1,)
+        for p in self.paths:
+            p_str = utility.val_to_str(p,tab_level=tab_level+2)
+            rtn_str = '%s%s,\n'%(rtn_str,p_str)
+        rtn_str = '%s%s]\n'%(rtn_str,tab_str1,)
+        rtn_str = '%s%s);\n'%(rtn_str,tab_str0)
+        return rtn_str

py2scad/transforms.py

+"""
+Copyright 2010  IO Rodeo Inc. 
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+"""
+import base
+import utility
+
+# 3D transformations ---------------------------------------------------------
+
+class Scale(base.SCAD_CMP_Object):
+
+    def __init__(self,obj,v=[1.0,1.0,1.0], mod=''):
+        base.SCAD_CMP_Object.__init__(self, obj, mod=mod)
+        self.v = utility.float_list3(v)
+
+    def cmd_str(self,tab_level=0):
+        v_str = utility.val_to_str(self.v)
+        return 'scale(v=%s)'%(v_str)
+
+class Rotate(base.SCAD_CMP_Object):
+
+    def __init__(self,obj,a=0.0,v=[1.0,0.0,0.0],mod=''):
+        base.SCAD_CMP_Object.__init__(self,obj,mod=mod)
+        self.a = float(a)
+        self.v = utility.float_list3(v) 
+
+    def cmd_str(self,tab_level=0):
+        a_str = utility.val_to_str(self.a)
+        v_str = utility.val_to_str(self.v)
+        return 'rotate(a=%s,v=%s)'%(a_str,v_str)
+
+class AnimRotate(base.SCAD_CMP_Object):
+
+    def __init__(self,obj,a=0.0,v=[0.0,0.0,0.0],mod=''):
+        base.SCAD_CMP_Object.__init__(self,obj,mod=mod)
+        self.a = a
+        self.v = v
+
+    def cmd_str(self,tab_level=0):
+        return 'rotate(a=%s,v=%s)'%(self.a,self.v)
+
+class Translate(base.SCAD_CMP_Object):
+
+    def __init__(self,obj,v=[0.0,0.0,0.0],mod=''):
+        base.SCAD_CMP_Object.__init__(self,obj,mod=mod)
+        self.v = utility.float_list3(v)
+
+    def cmd_str(self,tab_level=0):
+        v_str = utility.val_to_str(self.v)
+        return 'translate(v=%s)'%(v_str,)
+
+class AnimTranslate(base.SCAD_CMP_Object):
+
+    def __init__(self,obj,v=[0.0,0.0,0.0],mod=''):
+        base.SCAD_CMP_Object.__init__(self,obj,mod=mod)
+        self.v = v
+
+    def cmd_str(self,tab_level=0):
+        return 'translate(v=%s)'%(self.v,)
+       
+class Mirror(base.SCAD_CMP_Object):
+
+    def __init__(self,obj,v=[1.0,0.0,0.0],mod=''):
+        base.SCAD_CMP_Object.__init__(self,obj,mod=mod)
+        self.v = utility.float_list3(v)
+
+    def cmd_str(self,tab_level=0):
+        v_str = utility.val_to_str(self.v)
+        return 'mirror(v=%s)'%(v_str,)
+
+class MultMatrix(base.SCAD_CMP_Object):
+
+    #######################################
+    # NOT DONE
+    #######################################
+
+    def __init__(self,obj):
+        base.SCAD_CMP_Object.__init__(self,obj,mod=mod)
+        pass
+
+class Color(base.SCAD_CMP_Object):
+
+    def __init__(self,obj,rgba=[0.5, 0.5, 0.5, 1.0],mod=''):
+        base.SCAD_CMP_Object.__init__(self,obj,mod=mod)
+        self.rgba = utility.float_list4(rgba)
+        assert self.rgba_ok(), 'rgba values must be in [0,1]'
+
+    def cmd_str(self,tab_level=0):
+        rgba_str = utility.val_to_str(self.rgba)
+        return 'color(%s)'%(rgba_str,)
+
+    def rgba_ok(self):
+        for x in self.rgba:
+            if x < 0.0 or x > 1.0:
+                return False
+        return True
+
+# CGS Operations -------------------------------------------------------------
+
+class Union(base.SCAD_CMP_Object):
+
+    def cmd_str(self,tab_level=0):
+        return 'union()'
+
+class Difference(base.SCAD_CMP_Object):
+
+    def cmd_str(self,tab_level=0):
+        return 'difference()'
+
+class Intersection(base.SCAD_CMP_Object):
+
+    def cmd_str(self,tab_level=0):
+        return 'intersection()'
+    
+# 2D to 3D Extrusion -----------------------------------------------------------
+
+class Linear_Extrude(base.SCAD_CMP_Object):
+
+    def __init__(self,obj,h=1, twist=0, center=True, mod='', convexity=5,slices=None):
+        base.SCAD_CMP_Object.__init__(self,obj,center=center,mod=mod)
+        self.h = float(h)
+        self.twist = float(twist)
+        self.convexity = int(convexity)
+        try:
+            self.slices = int(slices)
+        except TypeError:
+            self.slices = None
+
+    def cmd_str(self,tab_level=0):
+        h_str = utility.val_to_str(self.h)
+        twist_str = utility.val_to_str(self.twist)
+        center_str = self.center_str()
+        if self.slices == None:
+            str_tup = (h_str,twist_str,center_str,self.convexity)
+            rtn_str = 'linear_extrude(height=%s,twist=%s,center=%s,convexity=%d)'%str_tup
+        else:
+            str_tup = (h_str,twist_str,center_str,self.convexity,self.slices)
+            rtn_str = 'linear_extrude(height=%s,twist=%s,center=%s,convexity=%d,slices=%d)'%str_tup
+        return rtn_str
+
+
+class Rotate_Extrude(base.SCAD_CMP_Object):
+
+    def __init__(self,obj,convexity=5,mod=''):
+        base.SCAD_CMP_Object.__init__(self,obj,mod=mod)
+        self.convexity = convexity
+
+    def cmd_str(self,tab_level=0):
+        rtn_str = 'rotate_extrude(convexity=%d)'%(self.convexity,)
+        return rtn_str

py2scad/utility.py

+"""
+Copyright 2010  IO Rodeo Inc. 
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+"""
+import math
+
+TAB_WIDTH = 4
+DEG2RAD = math.pi/180.0
+RAD2DEG = 180.0/math.pi
+
+# Utility functions -----------------------------------------------------------
+
+def float_list2(v):
+    _v = float_list(v)
+    assert len(_v) == 2, 'v must be convertable to a length2 list'
+    return _v
+
+def float_list3(v):
+    _v = float_list(v)
+    assert len(_v) == 3, 'v must be convertible to a length 3 list'
+    return _v
+
+def float_list4(v):
+    _v = float_list(v)
+    assert len(_v) == 4, 'v must be convertible to a length 4 list'
+    return _v
+
+def float_list(v):
+    _v = list(v)
+    _v = [float(x) for x in _v]
+    return _v
+
+def val_to_str(x,tab_level=0):
+    tab_str = ' '*TAB_WIDTH*tab_level
+    if type(x) == float:
+        x_str = '%s%f'%(tab_str,x,)
+    else:
+        x_str = '%s['%(tab_str,)
+        cnt = 0
+        for i,y in enumerate(x):
+            x_str = '%s%s'%(x_str,val_to_str(y))
+            if i < len(x)-1:
+                x_str = '%s, '%(x_str,)
+            cnt += 1
+            if cnt >= 8:
+                cnt = 0
+                x_str = '%s\n%s'%(x_str,tab_str)
+        x_str = '%s]'%(x_str,)
+    return x_str
+
+def write_obj_list(obj_list, filename, fn=100):
+    fid = open(filename,'w')
+    fid.write('$fn=%d;\n'%(fn,))
+    for obj in obj_list:
+        fid.write('%s\n'%(obj,))
+    fid.close()
+
+"""
+Copyright 2010  IO Rodeo Inc. 
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+"""
+from setuptools import setup, find_packages
+
+setup(name='simple_step',
+      version='0.1', 
+      description = 'library for creating OpenSCAD models',
+      author = 'William Dickson, IO Rodeo Inc.',
+      author_email = 'will@iorodeo.com',
+      packages=find_packages(),
+      )
+      
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.