rhinomcp 0.1.3.2__py3-none-any.whl → 0.1.3.4__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- rhinomcp/tools/create_object.py +35 -1
- rhinomcp/tools/get_object_info.py +21 -6
- rhinomcp/tools/get_selected_objects_info.py +7 -3
- {rhinomcp-0.1.3.2.dist-info → rhinomcp-0.1.3.4.dist-info}/METADATA +1 -1
- {rhinomcp-0.1.3.2.dist-info → rhinomcp-0.1.3.4.dist-info}/RECORD +8 -8
- {rhinomcp-0.1.3.2.dist-info → rhinomcp-0.1.3.4.dist-info}/WHEEL +1 -1
- {rhinomcp-0.1.3.2.dist-info → rhinomcp-0.1.3.4.dist-info}/entry_points.txt +0 -0
- {rhinomcp-0.1.3.2.dist-info → rhinomcp-0.1.3.4.dist-info}/top_level.txt +0 -0
rhinomcp/tools/create_object.py
CHANGED
@@ -18,7 +18,7 @@ def create_object(
|
|
18
18
|
Create a new object in the Rhino document.
|
19
19
|
|
20
20
|
Parameters:
|
21
|
-
- type: Object type ("POINT", "LINE", "POLYLINE", "CURVE", "BOX", "SPHERE")
|
21
|
+
- type: Object type ("POINT", "LINE", "POLYLINE", "CIRCLE", "ARC", "ELLIPSE", "CURVE", "BOX", "SPHERE", "CONE", "CYLINDER", "PIPE", "SURFACE")
|
22
22
|
- name: Optional name for the object
|
23
23
|
- color: Optional [r, g, b] color values (0-255) for the object
|
24
24
|
- params: Type-specific parameters dictionary (see documentation for each type)
|
@@ -39,6 +39,20 @@ def create_object(
|
|
39
39
|
For POLYLINE, the params dictionary should contain the following keys:
|
40
40
|
- points: List of [x, y, z] points that define the polyline
|
41
41
|
|
42
|
+
For CIRCLE, the params dictionary should contain the following keys:
|
43
|
+
- center: [x, y, z] center point of the circle
|
44
|
+
- radius: Radius of the circle
|
45
|
+
|
46
|
+
For ARC, the params dictionary should contain the following keys:
|
47
|
+
- center: [x, y, z] center point of the arc
|
48
|
+
- radius: Radius of the arc
|
49
|
+
- angle: Angle of the arc in degrees
|
50
|
+
|
51
|
+
For ELLIPSE, the params dictionary should contain the following keys:
|
52
|
+
- center: [x, y, z] center point of the ellipse
|
53
|
+
- radius_x: Radius of the ellipse along X axis
|
54
|
+
- radius_y: Radius of the ellipse along Y axis
|
55
|
+
|
42
56
|
For CURVE, the params dictionary should contain the following keys:
|
43
57
|
- points: List of [x, y, z] control points that define the curve
|
44
58
|
- degree: Degree of the curve (default is 3, if user asked for smoother curve, degree can be higher)
|
@@ -51,6 +65,22 @@ def create_object(
|
|
51
65
|
|
52
66
|
For SPHERE, the params dictionary should contain the following key:
|
53
67
|
- radius: Radius of the sphere
|
68
|
+
|
69
|
+
For CONE, the params dictionary should contain the following keys:
|
70
|
+
- radius: Radius of the cone
|
71
|
+
- height: Height of the cone
|
72
|
+
- cap: Boolean to indicate if the cone should be capped at the base, default is True
|
73
|
+
|
74
|
+
For CYLINDER, the params dictionary should contain the following keys:
|
75
|
+
- radius: Radius of the cylinder
|
76
|
+
- height: Height of the cylinder
|
77
|
+
- cap: Boolean to indicate if the cylinder should be capped at the base, default is True
|
78
|
+
|
79
|
+
For SURFACE, the params dictionary should contain the following keys:
|
80
|
+
- count : ([number, number]) Tuple of two numbers defining number of points in the u,v directions
|
81
|
+
- points: List of [x, y, z] points that define the surface
|
82
|
+
- degree: ([number, number], optional) Degree of the surface (default is 3, if user asked for smoother surface, degree can be higher)
|
83
|
+
- closed: ([bool, bool], optional) Two booleans defining if the surface is closed in the u,v directions
|
54
84
|
|
55
85
|
Returns:
|
56
86
|
A message indicating the created object name.
|
@@ -59,9 +89,13 @@ def create_object(
|
|
59
89
|
- POINT: {"x": 0, "y": 0, "z": 0}
|
60
90
|
- LINE: {"start": [0, 0, 0], "end": [1, 1, 1]}
|
61
91
|
- POLYLINE: {"points": [[0, 0, 0], [1, 1, 1], [2, 2, 2]]}
|
92
|
+
- CIRCLE: {"center": [0, 0, 0], "radius": 1.0}
|
62
93
|
- CURVE: {"points": [[0, 0, 0], [1, 1, 1], [2, 2, 2]], "degree": 3}
|
63
94
|
- BOX: {"width": 1.0, "length": 1.0, "height": 1.0}
|
64
95
|
- SPHERE: {"radius": 1.0}
|
96
|
+
- CONE: {"radius": 1.0, "height": 1.0, "cap": True}
|
97
|
+
- CYLINDER: {"radius": 1.0, "height": 1.0, "cap": True}
|
98
|
+
- SURFACE: {"count": (3, 3), "points": [[0, 0, 0], [1, 0, 0], [2, 0, 0], [0, 1, 0], [1, 1, 0], [2, 1, 0], [0, 2, 0], [1, 2, 0], [2, 2, 0]], "degree": (3, 3), "closed": (False, False)}
|
65
99
|
"""
|
66
100
|
try:
|
67
101
|
# Get the global connection
|
@@ -1,13 +1,28 @@
|
|
1
1
|
from mcp.server.fastmcp import Context
|
2
2
|
import json
|
3
3
|
from rhinomcp import get_rhino_connection, mcp, logger
|
4
|
+
from typing import Dict, Any
|
4
5
|
|
5
6
|
@mcp.tool()
|
6
|
-
def get_object_info(ctx: Context, id: str = None, name: str = None) -> str:
|
7
|
+
def get_object_info(ctx: Context, id: str = None, name: str = None) -> Dict[str, Any]:
|
7
8
|
"""
|
8
9
|
Get detailed information about a specific object in the Rhino document.
|
10
|
+
The information contains the object's id, name, type, all custom user attributes and geometry info.
|
9
11
|
You can either provide the id or the object_name of the object to get information about.
|
10
12
|
If both are provided, the id will be used.
|
13
|
+
|
14
|
+
Returns:
|
15
|
+
- A dictionary containing the object's information
|
16
|
+
- The dictionary will have the following keys:
|
17
|
+
- "id": The id of the object
|
18
|
+
- "name": The name of the object
|
19
|
+
- "type": The type of the object
|
20
|
+
- "layer": The layer of the object
|
21
|
+
- "material": The material of the object
|
22
|
+
- "color": The color of the object
|
23
|
+
- "bounding_box": The bounding box of the object
|
24
|
+
- "geometry": The geometry info of the object
|
25
|
+
- "attributes": A dictionary containing all custom user attributes of the object
|
11
26
|
|
12
27
|
Parameters:
|
13
28
|
- id: The id of the object to get information about
|
@@ -15,10 +30,10 @@ def get_object_info(ctx: Context, id: str = None, name: str = None) -> str:
|
|
15
30
|
"""
|
16
31
|
try:
|
17
32
|
rhino = get_rhino_connection()
|
18
|
-
|
19
|
-
|
20
|
-
# Just return the JSON representation of what Rhino sent us
|
21
|
-
return json.dumps(result, indent=2)
|
33
|
+
return rhino.send_command("get_object_info", {"id": id, "name": name})
|
34
|
+
|
22
35
|
except Exception as e:
|
23
36
|
logger.error(f"Error getting object info from Rhino: {str(e)}")
|
24
|
-
return
|
37
|
+
return {
|
38
|
+
"error": str(e)
|
39
|
+
}
|
@@ -3,11 +3,15 @@ import json
|
|
3
3
|
from rhinomcp import get_rhino_connection, mcp, logger
|
4
4
|
|
5
5
|
@mcp.tool()
|
6
|
-
def get_selected_objects_info(ctx: Context) -> str:
|
7
|
-
"""Get detailed information about the currently selected objects in Rhino
|
6
|
+
def get_selected_objects_info(ctx: Context, include_attributes: bool = False) -> str:
|
7
|
+
"""Get detailed information about the currently selected objects in Rhino
|
8
|
+
|
9
|
+
Parameters:
|
10
|
+
- include_attributes: Whether to include the custom user attributes of the objects in the response
|
11
|
+
"""
|
8
12
|
try:
|
9
13
|
rhino = get_rhino_connection()
|
10
|
-
result = rhino.send_command("get_selected_objects_info")
|
14
|
+
result = rhino.send_command("get_selected_objects_info", {"include_attributes": include_attributes})
|
11
15
|
return json.dumps(result, indent=2)
|
12
16
|
except Exception as e:
|
13
17
|
logger.error(f"Error getting selected objects from Rhino: {str(e)}")
|
@@ -3,22 +3,22 @@ rhinomcp/server.py,sha256=fbEs4HBLWTudg-e6BpFz294JV8pruqw8yBRgrmlEV2w,9415
|
|
3
3
|
rhinomcp/prompts/assert_general_strategy.py,sha256=Aovach0WYClUw191iX_Mwyh2KlxdVp0gB2Wt4eiQDvM,1250
|
4
4
|
rhinomcp/static/rhinoscriptsyntax.py,sha256=xrIBMxVs9qTXIzDQT3jLILF4TS-7MbNMqJrBY5KlOUk,1480485
|
5
5
|
rhinomcp/tools/create_layer.py,sha256=Pz6xgKsiNZGRcUwc4nQrvSWwRNc9Uv5Vs4g-lKQz82c,1377
|
6
|
-
rhinomcp/tools/create_object.py,sha256=
|
6
|
+
rhinomcp/tools/create_object.py,sha256=fcdqnbKZJhDcLdLCcJfdd1HW7gBkzSjT8CqHHE38ZQk,5292
|
7
7
|
rhinomcp/tools/create_objects.py,sha256=974VI3C_iLjz9nJ6ya0fwxbsI0u0rlyb_cM98W6T86U,2616
|
8
8
|
rhinomcp/tools/delete_layer.py,sha256=MjvN2-AKHD1dbMIMqfrb3Bevjj63ooWGzqlFpOopju8,1315
|
9
9
|
rhinomcp/tools/delete_object.py,sha256=-Vz1AZlw0-hPQZ9wNVTpa5sRDJ2qLiDnfjSYKp2wafc,987
|
10
10
|
rhinomcp/tools/execute_rhinoscript_python_code.py,sha256=iHaXptYxGc0YY_oxBn_qwYr3l14ycjirRW96Q78eEPY,1585
|
11
11
|
rhinomcp/tools/get_document_info.py,sha256=poPyqfO0KeV5Au3jks9Q3o6tTZVDfEuCm9BZWCLfpqY,613
|
12
|
-
rhinomcp/tools/get_object_info.py,sha256=
|
12
|
+
rhinomcp/tools/get_object_info.py,sha256=LRVY__C8CA_-Wux9GGRaXHB3W7FHcrQa1DCXAOiZWgg,1564
|
13
13
|
rhinomcp/tools/get_or_set_current_layer.py,sha256=xIvwvrmWXjnxC0WDLEMFxLAUOUjL8LD-8sQ2OYPO-nw,1493
|
14
14
|
rhinomcp/tools/get_rhinoscript_python_code_guide.py,sha256=phS1tCive-lwlWOrE4UW4Ydl1CDuGfqCYU9x6MuQgKY,928
|
15
15
|
rhinomcp/tools/get_rhinoscript_python_function_names.py,sha256=YLDtE8TIFXlMqcUSSpMLshoyB5bxPYiiwcsVY1phsSQ,1360
|
16
|
-
rhinomcp/tools/get_selected_objects_info.py,sha256=
|
16
|
+
rhinomcp/tools/get_selected_objects_info.py,sha256=TG9pUz1NscYOoSUQN-vnl-zuILbjd9GAouJtT9oxUbk,780
|
17
17
|
rhinomcp/tools/modify_object.py,sha256=OVQa75PAmuVx-YslxSC2ITdFbp6cCELVaacI77sJ7Zg,1912
|
18
18
|
rhinomcp/tools/modify_objects.py,sha256=52okeGwV5IQiuBSBH9HcyDCxWbCNF4eA7LoLuhLlgp4,1498
|
19
19
|
rhinomcp/tools/select_objects.py,sha256=J9QjfnD9gdepTCqalBDqOi9nJEX9D3sLPJKImTcJciI,1935
|
20
|
-
rhinomcp-0.1.3.
|
21
|
-
rhinomcp-0.1.3.
|
22
|
-
rhinomcp-0.1.3.
|
23
|
-
rhinomcp-0.1.3.
|
24
|
-
rhinomcp-0.1.3.
|
20
|
+
rhinomcp-0.1.3.4.dist-info/METADATA,sha256=Tq7xw_flkVOwRtPAazh_mgG6WPOIu7qX88AnSoTqhDg,920
|
21
|
+
rhinomcp-0.1.3.4.dist-info/WHEEL,sha256=ck4Vq1_RXyvS4Jt6SI0Vz6fyVs4GWg7AINwpsaGEgPE,91
|
22
|
+
rhinomcp-0.1.3.4.dist-info/entry_points.txt,sha256=OserOidtKWCl-_h3O1c2e9La6wYmJ9rE5F_T5wRLX9w,50
|
23
|
+
rhinomcp-0.1.3.4.dist-info/top_level.txt,sha256=sw73qoWC7GQp5upujkME6pRWc8OxBydEeDwQqu-qv4U,9
|
24
|
+
rhinomcp-0.1.3.4.dist-info/RECORD,,
|
File without changes
|
File without changes
|