phg-vis 1.1.6__tar.gz → 1.2.0__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: phg_vis
3
- Version: 1.1.6
3
+ Version: 1.2.0
4
4
  Summary: A package for the PHG modeling language and 3D visualization tool.
5
5
  Home-page: https://github.com/panguojun/Coordinate-System
6
6
  Author: romeosoft
Binary file
Binary file
@@ -1,4 +1,4 @@
1
- CAMERA=0.000,10.000,18.000;0.000,0.000,0.000;0.000,1.000,0.000;0.724;1.610
1
+ CAMERA=0.000,10.000,18.000;0.000,0.000,0.000;0.000,1.000,0.000;0.724;1.610;0;10.000;0.000,0.000,0.000
2
2
  CONSOLE=true
3
3
  ENABLE_DUAL_SCREEN=false
4
4
  HOSTIP=127.0.0.1
@@ -35,18 +35,21 @@ def vis(phg):
35
35
  return HTTPPOST('127.0.0.1', phg.encode())
36
36
 
37
37
  # Send network message
38
- def HTTPPOST_IMG(ip, phg):
38
+ def HTTPPOST_IMG(ip, phg, filename='shot.png'):
39
39
  headers = {
40
40
  "Connection": "keep-alive",
41
41
  "Content-Type": "text/plain"
42
42
  }
43
+ # 构建完整的请求体: phg代码 ||| 渲染参数(包含文件名)
44
+ request_body = f"{phg}|||file={filename}"
45
+
43
46
  conn = http.client.HTTPConnection(f"{ip}:5088")
44
- conn.request('POST', '/phg_img', phg, headers)
47
+ conn.request('POST', '/phg_img', request_body, headers)
45
48
  res = conn.getresponse()
46
49
  conn.close()
47
-
50
+
48
51
  # Call HTTPPOST function to send network message
49
- def image(phg):
52
+ def image(phg, filename='shot.png'):
50
53
  if not is_vis_running(): # Check if the process is running
51
54
  subprocess.Popen(vis_exe_path) # Start the process
52
- return HTTPPOST_IMG('127.0.0.1', phg.encode())
55
+ return HTTPPOST_IMG('127.0.0.1', phg.encode('utf-8').decode('utf-8'), filename)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: phg_vis
3
- Version: 1.1.6
3
+ Version: 1.2.0
4
4
  Summary: A package for the PHG modeling language and 3D visualization tool.
5
5
  Home-page: https://github.com/panguojun/Coordinate-System
6
6
  Author: romeosoft
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name='phg_vis',
5
- version='1.1.6',
5
+ version='1.2.0',
6
6
  packages=find_packages(),
7
7
  include_package_data=True,
8
8
  description='A package for the PHG modeling language and 3D visualization tool.',
Binary file
Binary file
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes