1111import java .security .cert .X509Certificate ;
1212
1313//CSG Client class that maintains connection and provides clean API
14- class CSGClient {
14+ public class CSGClient {
1515 // statics
1616 private static CSGClient client = null ;
1717
@@ -71,7 +71,9 @@ public void checkServerTrusted(X509Certificate[] certs, String authType) {
7171 public ArrayList <CSG > union (List <CSG > csgList ) throws Exception {
7272 return performOperation (csgList , CSGRemoteOperation .UNION );
7373 }
74-
74+ public ArrayList <CSG > hull (List <Vector3d > points , PropertyStorage storage ) throws Exception {
75+ return performOperation (new ArrayList <CSG >(), CSGRemoteOperation .hull ,points ,storage );
76+ }
7577 /**
7678 * Perform difference operations on consecutive CSG pairs
7779 *
@@ -119,11 +121,16 @@ public ArrayList<CSG> minkowskiHullShape(ArrayList<CSG> csgList) throws Exceptio
119121 public ArrayList <CSG > triangulate (ArrayList <CSG > csgList ) throws Exception {
120122 return performOperation (csgList , CSGRemoteOperation .TRIANGULATE );
121123 }
122-
123124 /**
124125 * Internal method to perform operations and handle request/response
125126 */
126- private ArrayList <CSG > performOperation (List <CSG > csgList , CSGRemoteOperation operation ) throws Exception {
127+ private ArrayList <CSG > performOperation (List <CSG > csgList , CSGRemoteOperation operation )throws Exception {
128+ return performOperation (csgList ,operation ,null ,null );
129+ }
130+ /**
131+ * Internal method to perform operations and handle request/response
132+ */
133+ private ArrayList <CSG > performOperation (List <CSG > csgList , CSGRemoteOperation operation ,List <Vector3d > points , PropertyStorage storage ) throws Exception {
127134 ArrayList <CSG > back = null ;
128135 SSLSocket socket = (SSLSocket ) factory .createSocket (hostname , port );
129136 try {
@@ -142,7 +149,7 @@ private ArrayList<CSG> performOperation(List<CSG> csgList, CSGRemoteOperation op
142149 tmp .setRegenerate (null );
143150 toSend .add (tmp );
144151 }
145- CSGRequest request = new CSGRequest (toSend , operation );
152+ CSGRequest request = new CSGRequest (toSend , operation , points , storage );
146153 if (key != null )
147154 request .setAPIKEY (key );
148155 oos .writeObject (request );
0 commit comments